There is a better way. If your implementation file that contains a local class is called xyz.cpp then write this under the class declaration:
#include "xyz.moc"
#include "xyz.moc"
To copy to clipboard, switch view to plain text mode
This instructs qmake to force running moc on xyz.cpp. Remember to rerun qmake after you add this statement.
class MyLocalClass
: public QObject { Q_OBJECT
public:
// ...
};
#include "myfile.moc"
class MyLocalClass : public QObject {
Q_OBJECT
public:
// ...
};
#include "myfile.moc"
To copy to clipboard, switch view to plain text mode
Bookmarks