晕,大哥,服了你了.
你都没有定义你的槽函数,怎么可能连接呢?受不了你.
class HelloForm : public HelloBaseForm
{
Q_OBJECT
public:
HelloForm( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 );
virtual ~HelloForm();
QPushButton* PushButton2;
QLabel* Label1;
QTimer* Timer1;
protected:
virtual void text();
virtual void SayHello();
};
上面是你的.h文件的一部分,你知道slot是什么意思不?
不知道为什么你一定要用虚函数,如果不是必须的话,建议修改如下:
.
.
.
public:
中间的函数省略
.
.
slots:
void text();
.
.
.
关键是那个slots,这是定义你自己的槽函数的地方.
你应该去看看关于信号和槽机制的例子,看看文档吧.