How to programmatically click a QPushButton

后端 未结 3 810
暖寄归人
暖寄归人 2021-01-07 20:40

I am using Qt. I have a button in the page added via the Qt Creator. It is connected to the method void MyPage::on_startButton_clicked().

I want to prog

3条回答
  •  没有蜡笔的小新
    2021-01-07 21:44

    Use QAbstractButton::animateClick():

    QPushButton* startButton = new QPushButton("Start");
    startButton->animateClick();
    

提交回复
热议问题