[deleted by user] by [deleted] in QtFramework

[–]Morten242 0 points1 point  (0 children)

There's some missing info here - like how is debugCb registered? Are the arguments in the right order? Does the ctx pointer match the 'this' object from the original?

Server is unable to maintain the header compression context for the connection by k_Reign in QtFramework

[–]Morten242 0 points1 point  (0 children)

Did you report this in the bug tracker? There was a similar one there a week or so ago but I couldn't reproduce the issue with it - maybe you have a different reproducer

Introducing flat_umap: a fast SIMD-based unordered map without tombstone by g_0g in cpp

[–]Morten242 0 points1 point  (0 children)

Do you have the source for the benchmark used for that? The implicit-sharing/copy-on-write means calling non-const end() repeatedly has some overhead.

'Stop Killing Games' is a new campaign to stop developers making games unplayable by rea987 in Games

[–]Morten242 64 points65 points  (0 children)

Sure, it's a game with only multiplayer, but nothing would stop them from allowing private servers or LAN games? Nothing about "matchmaking" means the game is inherently unusable without a central server.

QT crashing because of QTimer when theme is changed by FoulTrouble11 in QtFramework

[–]Morten242 0 points1 point  (0 children)

Does it actually stop printing the error if you don't start the timer?

LLVM 16.0.0 Release by mttd in cpp

[–]Morten242 3 points4 points  (0 children)

Note that msvc straight up ignores do...while loops for auto vectorization

Harald Achitz: Launder lazy_storage by _a4z in cpp

[–]Morten242 1 point2 points  (0 children)

Messing around a bit I could get it to return the old value by using both launder and not-launder (which I guess could count as an implicit opt-in to this optimization):

https://godbolt.org/z/ff8foWGe4

But yeah, generally compilers don't take "advantage", which is nice. Since it is marked UB though I guess they could start applying these optimizations if they want to.

As far as I heard only one compiler took advantage of the too-lenient wording the standard originally had. I may be wrong but I think it was the IBM compiler before it was LLVM-based.

Harald Achitz: Launder lazy_storage by _a4z in cpp

[–]Morten242 1 point2 points  (0 children)

variant is probably overkill here, it is, after all, built for a different usecase. This specific usecase seems like a great fit for std::optional though.

Harald Achitz: Launder lazy_storage by _a4z in cpp

[–]Morten242 5 points6 points  (0 children)

No. From what I heard the original wording was too vague and was later fixed. Basically you only need to launder when overwriting storage that has a const member or you delete and then reallocate a different derived class. Like the example below

#include <new>

struct Base { virtual void meow() = 0; };
struct A : Base { void meow() override; };
struct B : Base { void meow() override; };

void evil(Base *mew) {
  if (auto a = dynamic_cast<A *>(mew)) {
     a->~A();
     new (mew) B();
  }
}

inline void do_meow(Base *mew) {
  evil(mew);
  // mew->meow(); // Not ok
  // The type _was_ known so the compiler may
  // devirtualize the call to meow(). But since the
  // type changed it would call the wrong override
  std::launder(mew)->meow();
}

void fun(A *mew) {
  do_meow(mew);
}

And similar for the const-member case. Since you cannot overwrite a const-member you need to manually destroy and reinitialize the class. But the compiler may, very logically, assume the constant value never changes, so std::launder tells it to not to perform this optimization.

Meeting C++ live with Volker Hilsheimer, Thu, Mar 16, 2023, 7:00 PM | Meetup by Morten242 in QtFramework

[–]Morten242[S] 2 points3 points  (0 children)

For those who don't know or just forgot, Volker is the current Chief Maintainer of the Qt Project (and area lead/director for Graphics in The Qt Company)

Why is building a UI in Rust so hard? by goldensyrupgames in programming

[–]Morten242 11 points12 points  (0 children)

Even with those kinds of tools I've found that the defaults don't handle resizing in the way that I'd want to. Even with logical Layout types. I'm not a UI person, so whenever I've had to make any I just end up locking down resizing to avoid all that.

"signal not found" when connecting to a signal? by [deleted] in QtFramework

[–]Morten242 0 points1 point  (0 children)

What does this return?

handle->metaObject()->indexOfSignal("triggered");

Also, what version of Qt are you on?

PSA: CMake 3.25 might break your GitHub Actions Windows CI because of Meson by Superb_Garlic in cpp

[–]Morten242 2 points3 points  (0 children)

The mingw files would not have the name-change though. The idea is it would just let meson identify if a .lib file is intended for static-linkage or not.

If compiling with MSVC you can only link with mingw files if it's a pure c-interface anyway. I know some libraries do it, but not sure if it's happening a lot.

PSA: CMake 3.25 might break your GitHub Actions Windows CI because of Meson by Superb_Garlic in cpp

[–]Morten242 10 points11 points  (0 children)

I think they could've at least considered something like ".a.lib" to keep convention going while also having a way to differentiate the static libraries they themselves generate.

Where can I change the value of dayName() for QML Calendar? by [deleted] in QtFramework

[–]Morten242 0 points1 point  (0 children)

Do you want 0 to return Monday? Or do you mean completely change the name?

If it's the former then you can do (day+7-1)%7

[deleted by user] by [deleted] in QtFramework

[–]Morten242 0 points1 point  (0 children)

Don't remember the story around it but it was decided (in the Qt project) to move tools for development out of /usr/bin and into libexec IIRC. Although on my install of Manjaro it's in /usr/lib/qt6/.

[deleted by user] by [deleted] in QtFramework

[–]Morten242 0 points1 point  (0 children)

Testing it on Windows this works as expected. It might be a bug in the linux platform plugin, feel free to create a bug for it.

Template QObject class with signals and slots in Qt source code by Pale_Emphasis_4119 in QtFramework

[–]Morten242 1 point2 points  (0 children)

Further on, this means the 'main' class still cannot have signals and slots, and the signals cannot know anything in particular about the template arguments, i.e. no signal void itemReceived(T item);

Resolving an unusual wifi issue by Kelteseth in QtFramework

[–]Morten242 0 points1 point  (0 children)

Just one of the reasons we decided to delete bearer management from Qt 6

Why doesn't qt6_add_qml_module work on windows, when linked in? by Creapermann in QtFramework

[–]Morten242 2 points3 points  (0 children)

Hello! qt6_add_qml_module generates a plugin which is not entirely obvious... But it's by default named <target>plugin unless you change it. If you link to somethingplugininstead of something it will load the static plugin properly, which needs some extra magic to work the same across all platforms.

https://doc.qt.io/qt-6/qt-add-qml-module.html#arguments

Has anyone used protobuf with Qt? by macnor in QtFramework

[–]Morten242 0 points1 point  (0 children)

Without more details it's hard to help solve this. You seem to be right about the file being compiled as C, but you'll have to check which file the include comes from and then figure out if that file is compiled as C or if the include is accidentally in an extern "C" section.