Keyword "signals" used in a library
-
Hello,
I use QT4.8.3 and I have a problem in the compilation of my project because of a library that I include, a variable is called "signals". What are the solutions to avoid this kind of problem?Thanks in advance
Romain
-
Hello,
I use QT4.8.3 and I have a problem in the compilation of my project because of a library that I include, a variable is called "signals". What are the solutions to avoid this kind of problem?Thanks in advance
Romain
@Romain-Besso
CONFIG += no_keywords
https://doc.qt.io/qt-5/signalsandslots.html#3rd-party-signals-and-slots
but than you'll have to use the alternative macros
Q_SIGNALS (or Q_SIGNAL), Q_SLOTS (or Q_SLOT), and Q_EMIT
in all of your code.
Good luck refactoring :D -
@Romain-Besso
CONFIG += no_keywords
https://doc.qt.io/qt-5/signalsandslots.html#3rd-party-signals-and-slots
but than you'll have to use the alternative macros
Q_SIGNALS (or Q_SIGNAL), Q_SLOTS (or Q_SLOT), and Q_EMIT
in all of your code.
Good luck refactoring :D@J-Hilk , @Romain-Besso
Correct me if I'm wrong, but in order to avoid that "refactoring": Are you able to place the library's
#include <...h>
statement somewhere in your code before you#include
anything from Qt (including watch out for nested includes)? If so won't that make it possible for the library to not see anysignals
definition from Qt, but after that the Qt definition takes over? Might be worth a stab first.... -
Ty for answers, what about #define QT_NO_KEYWORDS ?
-
Ty for answers, what about #define QT_NO_KEYWORDS ?
@Romain-Besso said in Keyword "signals" used in a library:
what about #define QT_NO_KEYWORDS ?
This is what
CONFIG += no_keywords
does for you.
-
@J-Hilk , @Romain-Besso
Correct me if I'm wrong, but in order to avoid that "refactoring": Are you able to place the library's
#include <...h>
statement somewhere in your code before you#include
anything from Qt (including watch out for nested includes)? If so won't that make it possible for the library to not see anysignals
definition from Qt, but after that the Qt definition takes over? Might be worth a stab first.... -
CONFIG += no_keywords also remove things like foreach, any solution to only remove signals slots emit ?
Because I really need to use foreach -
CONFIG += no_keywords also remove things like foreach, any solution to only remove signals slots emit ?
Because I really need to use foreach@Romain-Besso said in Keyword "signals" used in a library:
Because I really need to use foreach
Use Q_FOREACH then.
-
or better yet, the c++ range for
https://en.cppreference.com/w/cpp/language/range-forthat works with qt containers just fine