Both QObject and QTimer are contained in the QtCore module. You can simply inherit your class from QObject instead.
Qt Code:
{ Q_OBJECT }To copy to clipboard, switch view to plain text mode
Both QObject and QTimer are contained in the QtCore module. You can simply inherit your class from QObject instead.
Qt Code:
{ Q_OBJECT }To copy to clipboard, switch view to plain text mode
Thanks amoswood!
I have already tried to subclass QObject. The problem is then that QObject has no exec(), so the program can not have return Client.exec() in main.cpp.
I don't know what you are doing in your Client class, but you can work around the exec() function with the code or the Qt class QEventLoop:
Qt Code:
while(true) { }To copy to clipboard, switch view to plain text mode
gQt (10th June 2010)
The class QEventLoop solved the problem, thanksClient can subclass QEventLoop, and QEventLoop has also an exec() function, so it is still possible to have the Client.exec() in main.
Bookmarks