I came across an error which says I have an undefined reference to my slot. The relevant section from my header file is:
class Window : public QWidget {
Q_OBJECT
..... public slots:
void quit():
........... }
and from my implementation file is:
Window::Window() { ...... //Setting up Pushbutton
button1 = new QPushButton("Quit");
button1->show();
//Connecting
connect(button1, SIGNAL(clicked()), this, SLOT(quit()));
....... }
The error I get on compilation is:
undefined reference to `Window::quit()'
However, I believed that my use of 'this' in the connection code would make a defined reference to this. It has for my previous signals and slots when making connections. Also, I have used the 'quit' slot in a main window application - so I know that's a relevant slot to use.
From searching the forums, the problem is usually resolved by the use of 'this' in the connection part of the code - so I haven't been able to find a solution.