Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to programatically popup one of the QMenu's on my QMainWindow QMenuBar???

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

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 2.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    scumpyt
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    • A Offline
      A Offline
      alexander
      wrote on last edited by
      #2

      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.

      1 Reply Last reply
      0
      • S Offline
        S Offline
        scumpyt
        wrote on last edited by
        #3

        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

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved