I am having difficulty in my Qt program with connecting button signals to my slots. My code is:
Main.cpp
#include #include
Add Q_OBJECT to your class, like this:
Q_OBJECT
class MainWidget : public QWidget { Q_OBJECT
You also have to run moc to generate some helper code. qmake does that automatically for your, but if you compile this yourself, you need to run moc.