查看完整版本: [-- 点击按钮,clicked()无反应 --]

QTCN开发网 -> 《C++ GUI Qt 4编程》(第2版)专栏 -> 点击按钮,clicked()无反应 [打印本页] 登录 -> 注册 -> 回复主题 -> 发表主题

marlenechen 2017-09-28 22:16

点击按钮,clicked()无反应

书中有一段 说显示扩展对话框的实现,是:在单击more按钮时调用QPushButton中的setText()函数完成。

我写了:
        QObject::connect(moreButton, SIGNAL(clicked()), this, SLOT(isClicked()));

        QObject::connect(moreButton, SIGNAL(toggled(bool)), SecondaryGroupBox, SLOT(setVisible(bool)));
        QObject::connect(moreButton, SIGNAL(toggled(bool)), tertiaryGroupBox, SLOT(setVisible(bool)));

……

void CSortDialog::isClicked()
{
        if (moreButton->text() == "&More>>>")
        {
                moreButton->setText("&More<<<");
        }
        else
        {
                moreButton->setText("&More>>>");
        }
}

点击按钮后,为何没有反应?????


查看完整版本: [-- 点击按钮,clicked()无反应 --] [-- top --]



Powered by phpwind v8.7 Code ©2003-2011 phpwind
Gzip disabled