QT c++に疑問があります
これが main.cpp だとします
#include "head.h"
#include "tail.h"
int main()
{
head *head_obj = new head();
tail *tail_obj = new tail();
//some code
}
ここに頭があります.h
class head:public QWidget
{
Q_OBJECT
/* some code */
public slots:
void change_number();
};
ここにテールがあります.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()),?,?);
};
mytailbutton の信号 clicked() を head クラスのスロット change_number に接続するにはどうすればよいですか? これが可能になる方法はないと感じています。
お手伝いありがとう!