我对 QT c++ 有疑问
假设这是 main.cpp
#include "head.h"
#include "tail.h"
int main()
{
head *head_obj = new head();
tail *tail_obj = new tail();
//some code
}
这是head.h
class head:public QWidget
{
Q_OBJECT
/* some code */
public slots:
void change_number();
};
这是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()),?,?);
};
现在我如何将 mytailbutton 的信号 clicked() 连接到头类插槽 change_number?我只是觉得这不可能。
感谢您的帮助!