PDA

View Full Version : Set QButton to clicked as the result of a Menu Action



Mbc
14th April 2016, 15:27
Hello,

I did put a new Button to a main widget on mainwindow.ui, and have already a menu option " New Game". I created an evenHandler as

void MainWindow::on_actionNew_Game_triggered()
{
// Here I want to set my button status to "Clicked" as the reaction of New_Game_triggered()!!!!!

}

How to perform it?

So long I have not seen the creation of a new QBUtton object more than a visual creation on mainwindow.ui.

How to?

1. Create a QButton object, if needed?
2. How to set its status to "clicked"?

Best regards

Mbc

anda_skoa
14th April 2016, 16:24
Can you rephrase that?

If you activate the menu, why would you want to additionally simulate a button click?

Cheers,
_