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. Problem with QMenu and Mac
Forum Updated to NodeBB v4.3 + New Features

Problem with QMenu and Mac

Scheduled Pinned Locked Moved Solved General and Desktop
7 Posts 2 Posters 604 Views 2 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.
  • mrdebugM Offline
    mrdebugM Offline
    mrdebug
    wrote on last edited by
    #1

    Hi, these lines of code

        QMenu *Menu= new QMenu(this);
        QAction *QAction01= new QAction("01", this);
        QAction *QAction02= new QAction("02", this);
        QAction *QAction03= new QAction("03", this);
        Menu->addAction(QAction01);
        Menu->addAction(QAction02);
        Menu->addAction(QAction03);
        ui->actionMenu_02->setMenu(Menu);
    

    add actions ("Action 01", "Action 02", "Action 03") in an action called "Menu 02" of the main menu bar.
    The lines of code work perfectly on Linux and Windows but not on Mac.
    After having added the new actions, the original "Menu 02" action will disabled and I don't find a way to renenable it.
    On Mac I'm using Qt 5.9. Is this a bug?
    Is there a way to resolve?

    Need programmers to hire?
    www.labcsp.com
    www.denisgottardello.it
    GMT+1
    Skype: mrdebug

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      Can you provide a complete minimal code sample that shows that behaviour ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • mrdebugM Offline
        mrdebugM Offline
        mrdebug
        wrote on last edited by
        #3

        Please create a new QWidget project.
        After that please create a "File" menu and a sub item called "actionMenu_02" (such as "Open file").
        After that please add the lines of code above in the constructor.

        Need programmers to hire?
        www.labcsp.com
        www.denisgottardello.it
        GMT+1
        Skype: mrdebug

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Can't reproduce it here with the instructions you provided.

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0
          • mrdebugM Offline
            mrdebugM Offline
            mrdebug
            wrote on last edited by
            #5

            Screenshot_20191017_090303.png
            Screenshot_20191017_090335.png
            Screenshot_20191017_090409.png

            Qt 5.9.2
            Mac OSX 10.13.6 High Sierra

            Need programmers to hire?
            www.labcsp.com
            www.denisgottardello.it
            GMT+1
            Skype: mrdebug

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              I didn't say I didn't believe you, just that I wasn't able to reproduce that with the information at hand.

              Can you test your application with a more recent version of Qt ? 5.9.2 is outdated.

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply
              0
              • mrdebugM Offline
                mrdebugM Offline
                mrdebug
                wrote on last edited by
                #7

                Solved with the last Qt version.

                Need programmers to hire?
                www.labcsp.com
                www.denisgottardello.it
                GMT+1
                Skype: mrdebug

                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