QT 自己定义的几个槽函数 分别和不同的按钮进行connect 有的connect成功有的connect失败 5
槽函数的定义:privateslots:voidon_locatButton_cliecked();voidon_loginButton_cliecked();voido...
槽函数的定义:
private slots:
void on_locatButton_cliecked();
void on_loginButton_cliecked();
void on_resButton_cliecked();
槽函数的实现:
void firstqt::on_resButton_cliecked()
{
ui.StatusText->setText(QObject::tr("res ok"));
}
void firstqt::on_loginButton_cliecked()
{
ui.StatusText->setText(QObject::tr("login ok"));
}
void firstqt::on_locatButton_cliecked()
{
ui.StatusText->setText(QObject::tr("login ok"));
}
信号和槽的绑定:
QObject::connect(ui.ResistrationButton, SIGNAL(clicked()), this, SLOT(on_resButton_cliecked()));
QObject::connect(ui.LoginButton, SIGNAL(clicked()), this, SLOT(on_loginButton_cliecked()));
QObject::connect(ui.LocationButton, SIGNAL(clicked()), this, SLOT(on_locatButton_cliecked()));
问题就是 前两个connect成功 最后一个connect失败??这是为神马??? 展开
private slots:
void on_locatButton_cliecked();
void on_loginButton_cliecked();
void on_resButton_cliecked();
槽函数的实现:
void firstqt::on_resButton_cliecked()
{
ui.StatusText->setText(QObject::tr("res ok"));
}
void firstqt::on_loginButton_cliecked()
{
ui.StatusText->setText(QObject::tr("login ok"));
}
void firstqt::on_locatButton_cliecked()
{
ui.StatusText->setText(QObject::tr("login ok"));
}
信号和槽的绑定:
QObject::connect(ui.ResistrationButton, SIGNAL(clicked()), this, SLOT(on_resButton_cliecked()));
QObject::connect(ui.LoginButton, SIGNAL(clicked()), this, SLOT(on_loginButton_cliecked()));
QObject::connect(ui.LocationButton, SIGNAL(clicked()), this, SLOT(on_locatButton_cliecked()));
问题就是 前两个connect成功 最后一个connect失败??这是为神马??? 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询