Hey, my code compiles fine but I cannot connect my own functions to a signal. Is the reason because i have not put the Q_OBJECT macro in the class header file for the window?
if so when i do put this macro in i get 2 errors.
make: *** [debug] Error 2
make[1]: *** [debug\buttonTest.exe] Error 1
I was hoping if i fixed this then i would be able to connect signals to my own functions.
-----------------
Code:
{ Q_OBJECT public: { slider->setRange(0,99); slider->setValue(0); this, SLOT(Update(int))); //lcd, SLOT(display(int))); layout->addWidget(slider); layout->addWidget(lcd); layout->addWidget(button); this->setLayout(layout); } private slots: void Update(int i) { lcd->display(i); } private: QPushButton *button; QLCDNumber *lcd; QSlider *slider; };
Code:
//.pro file TEMPLATE = app TARGET = buttonTest QT += core \ gui HEADERS += buttontest.h SOURCES += main.cpp \ buttontest.cpp FORMS += buttontest.ui RESOURCES +=
