To use the QT Signal/Slot mechanism, sometimes you may want to make your classes to be subclasses of QObject.
It should be straight forward to inherit from QObject class and use marcro QObject to achieve the ability of QObject.
Note: The inherited QObject should be defined in a separate header file and cannot be defined in cpp. Because QT will generate some mock files by the existing header files, and those mock files may contain some QObject function implementations.
And for QT Makefile generation on Linux, the command is
$(QT_PATH)/bin/qmake -spec $(QT_PATH)/mkspecs/linux-g++ -o Makefile.linux proj.pro.
And proj.pro can be generated by QTCreator.
No comments:
Post a Comment