How to programatically popup one of the QMenu's on my QMainWindow QMenuBar???



  • I have a QMainWindow, with a normal QMenuBar (containing 2 QMenu's: "File" and "Help")

    When the application starts, I would like to programatically popup the "File" menu...

    What is the best way to do this?

    I have tried show() and raise(), and setVisible(true), etc...

    The only thing that I can get working is to call:

    menuFile->popup(QWidget::mapToParent(QPoint(0,21)));

    But that is questionable in that if I even move that menu in the menubar, it may not popup where it's suppose to...

    Any better ideas? I'm sure I'm missing something obvious, but it's minus 30 degrees here today, and my brain is probably frozen...

    Thanks in advance,

    Wayne



  • It's not good idea to show popup menu after start. It will be better to show wizard with menu items after start program. But you can try to call QAction::activate ( ActionEvent event ) for this menu QAction.



  • Alexander,

    Your idea of a wizard does sound like a better way to go. I'm going to implement that.

    Thanks for your time...

    Wayne


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.