cxx-qt icon indicating copy to clipboard operation
cxx-qt copied to clipboard

Do not use signals as Rust mod

Open jason-yau opened this issue 2 years ago • 4 comments

https://github.com/KDAB/cxx-qt/blob/main/examples/qml_features/src/signals.rs In this rust file, the signals word was used. It will generate a signals.cxxqt.h header file where signals will be used as its namespace. It will cause a problem that signals will be replaced by the Qt macro so that the MOC file will fail to be generated.

jason-yau avatar Jul 30 '22 17:07 jason-yau

Heh, a fun one :-)

But if we are building with QT_NO_KEYWORDS (like we have in the root CMake) is this a problem? As then it's not signals but Q_SIGNALS ?

ahayzen-kdab avatar Aug 01 '22 09:08 ahayzen-kdab

Hm, it's an example, not a test, so probably best to fix this, unless someone tries to copy that code into their own CMake and have things break. Should just be a simple rename.

LeonMatthesKDAB avatar Aug 03 '22 07:08 LeonMatthesKDAB

Right, with the new API though, i think this won't be a problem and will be "fixed" ? As you will need to specify a namespace yourself etc

ahayzen-kdab avatar Aug 03 '22 08:08 ahayzen-kdab

Fair point

LeonMatthesKDAB avatar Aug 03 '22 09:08 LeonMatthesKDAB

So with 0.4 there are a few changes here

  • Namespaces need to be written by the developer (so we don't just pick signals automatically)
  • The actual example has changed and it's now called RustSignals / rust_signals

So now i think this example will work correctly and not collide ? Therefore I'm closing this issue.

Once 0.4 is out and if this issue still occurs then please open a new issue :-)

ahayzen-kdab avatar Oct 24 '22 16:10 ahayzen-kdab