i have a doubt in QT c++
Suppose this is the main.cpp
#include "head.h"
#include "tail.h"
int main()
{
head *head_obj = new head();
tail *tail_obj = new tail();
//some code
}
here is the head.h
class head:public QWidget
{
Q_OBJECT
/* some code */
public slots:
void change_number();
};
here is the tail.h
class tail:public QWidget
{
Q_OBJECT
/* some code */
/* some code */
QPushButton *mytailbutton = new QPushButton("clickme");
//this is where i need help
connect(button,SIGNAL(clicked()),?,?);
};
Now how do i connect the mytailbutton's signal clicked() to head class slot change_number? i just kind of feel there is no way this is possible.
Thank you for the help!