Your class is derived from QWidget. Where is your #include <QWidget> (which will at some point include the header where Q_OBJECT is defined)?
Your class is derived from QWidget. Where is your #include <QWidget> (which will at some point include the header where Q_OBJECT is defined)?
Hi, Thanks for your reply. This program originally is working good without any problem. I already included QTGui in myqtapp.cpp file.
The problem occur once I add in the static library with 2 include header file [scsicmd.h] & [atacmd.h] then it failed to compiled and all error point to Q_OBJECT line.
In myqtapp.cpp which I not posted here, I already include
#include <QtGui>
#include "myqtapp.h"
What if you just separate UI and processing into to classes?
A sensible thing to do in any case and could totally avoid the problem you are seeing.
Cheers,
_
Possibly the problem is the private inheritance of Ui::myQtAppDLG. Try changing it to public or protected. The Q_OBJECT macro inserts some Qt meta-object source code into the class definition, and maybe this is incompatible with private inheritance of the UI class.
And take anda_skoa's suggestion for separating UI and processing code into different classes. It is never a good design to mix the two up. Makes for bad spaghetti.
Hi anda_skoa & d_stranz
I new with QT GUI, I using QT designer to generate a form. Then I use normal editor to write a source file. Original I use a sample code from internet which is running well. Once I add in my code [Not touch on any QT code] then it compiled error.
I not sure how to separate the UI, can you provide me guideline/example based on my above sample code? I had stuck with this many weeks.. really hope can settle it soon. bcoz backend I still need to do lots low level hardisk drive code.
I just need a simple GUI with few button, the button will send some hard disk command to retrieve some information. :-)
Thanks again.
I had try this, unfortunately still same error.
Bookmarks