I can't build this with error "undefined reference to vtable for CustomUndoStack"
Here's the code:
class CustomUndoStack : public QObject
{
Q_OBJECT
public:
};
int main(int argc, char *argv[])
{
QCoreApplication qCoreApplication(argc, argv);
CustomUndoStack uStack;
return qCoreApplication.exec();
}
Here's .pro file:
QT += widgets
CONFIG += c++14 console
CONFIG -= app_bundle
DEFINES += QT_DEPRECATED_WARNINGS
SOURCES += main.cpp
I've deleted manually the build directory, I've tried "Clean All" and "Rebuild All" in all possible ways, I've run qmake 100500 times, I've changed CustomUndoStack interface over 9000 times, but nothing helps.
Where's the problem?
UPD to answer the comment: if I remove Q_OBJECT line then I can't do this. It says that "No such signal QObject::undoSignal()"
class CustomUndoStack : public QObject
{
// Q_OBJECT
public:
CustomUndoStack() {
connect(this, SIGNAL(undo_signal()), &undoStack, SLOT(undo()));
}
signals:
void undo_signal();
private:
QUndoStack undoStack;
};