Weird compiler error while moving code from console to GUI
-
Hey, thanks for the answer! I have asked this question in several forums and it's the first answer I get... (!)
Could you be more specific please :) ?
Where should I place QT_NO_KEYWORDS? (i mean it seems not to be a function, neither a name type and the project file is about all the files, so, where do I place it?) -
I'm sorry, I was kinda in a hastle of getting home when I posted that ;).
What i meant is using
@
#define QT_NO_KEYWORDS
@
in every file where you have that problem. You'll also have to use Q_SIGNALS, Q_SLOTS and Q_EMIT instead of signals, slots, emit, respectively. The actual problem is that in that header file there is a member called "signals" which of course doesn't work well if Qt uses that as a keyword ;)EDIT: At the very beginning before any other includes, that is!
-
You must be quite a genius so as to guess that the word 'signals' made the trouble or I am the one who find it difficult to find from the info I've given from the 1st post?
Yes :) The part that seems to have problem is:
@
GDBusSignalInfo **signals;
@Thanks again, and, is there any way so as to solve this problem and not by calling
QT_NO_KEYWORDS ? Because the program is quite big and has a lot of signal (emit etc) calls and it needs a lot of work to be done :/ -
There should be no problem if there is not Qt header included before it. Also, why don't you just use Qt Creator to batch replace all occurrences of signals, slots and emit (You can do it either for just one project or for all files in a specific directory using Qt Creator's advanced search options).
[quote]You must be quite a genius so as to guess that the word ‘signals’ made the trouble or I am the one who find it difficult to find from the info I’ve given from the 1st post?[/quote]
While it is true that I'm a genius ;), I'm also just the usual geek using Linux, so I had a look at the file. -
Good to know that there seem to be lots of Linux users around :)
So, because I didn't get it 100%, I have to replace 'SLOT()' 'SIGNAL()' (both of them used while using connect()) and 'emit' with Q_SLOTS, Q_SIGNALS and Q_EMIT repsectively?
Or Q_SIGNALS is referring to the declaration of a signal (signals:) in a header file?
-
@slots: -> Q_SLOTS:
signals: -> Q_SIGNALS:
emit -> Q_EMIT@
http://doc.qt.nokia.com/4.7/qobject.html#Q_SIGNALSEDIT: fixed, sorry for the confusion
-
Yeah! Thanks again :) I'm gonna try it right now and I'll post back if I have any problems :)
-
Ok :)
It run very very well, a side notice btw, if I edited the SLOT() and SIGNAL() on the QObject::connect() function I got error, without it it run OK ;)
But I had to replace the other name types :D -
Hm, I had to use this library in one more file and there this definition doesn't seem to solve the problem :/