Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QtQuick 5.4 in QtCreator 5.5 Mac OS X 10.9.5: menuBar missing from template project on execute. What the???? [SOLVED]
QtWS25 Last Chance

QtQuick 5.4 in QtCreator 5.5 Mac OS X 10.9.5: menuBar missing from template project on execute. What the???? [SOLVED]

Scheduled Pinned Locked Moved QML and Qt Quick
qtbrokenqtquickqtcreatormenumenubartemplate
9 Posts 2 Posters 3.7k Views
  • 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.
  • D Offline
    D Offline
    DooziiInc
    wrote on last edited by DooziiInc
    #1

    Hi community,
    I am rather frustrated. I have just upgraded to QtCreator 5.5 for Mac OS X and created a new QtQuick Application and immediately after the project was generated, I ran the application. Upon running, I noticed that the menuBar is missing from the application but exists in the code. What is the deal here? Are the sample templates broken or did someone forget to compile something in the SDK??? I have spent the past 3 hours trying to find a solution or an indication as to why the menuBar is simply missing from the application.

    I am really interested in learning to use QtQuick, but I can't justify recommending it to my company if simple things like this require massive amounts of time to research and seek help over.

    Any ideas or help would be appreciated.

    I would like to add that the rest of the application seems to be running fine... just missing the menubar, it just not display at all in the application. Seems like there are several of these "weird" inconsistencies that we have encountered.

    Here is the code that is generated when the project is created:

    import QtQuick 2.5
    import QtQuick.Controls 1.4
    import QtQuick.Dialogs 1.2
    
    ApplicationWindow {
        visible: true
        width: 640
        height: 480
        title: qsTr("Hello World")
    
        menuBar: MenuBar {
            Menu {
                title: qsTr("File")
                MenuItem {
                    text: qsTr("&Open")
                    onTriggered: console.log("Open action triggered");
                }
                MenuItem {
                    text: qsTr("Exit")
                    onTriggered: Qt.quit();
                }
            }
        }
    
        MainForm {
            anchors.fill: parent
            button1.onClicked: messageDialog.show(qsTr("Button 1 pressed"))
            button2.onClicked: messageDialog.show(qsTr("Button 2 pressed"))
        }
    
        MessageDialog {
            id: messageDialog
            title: qsTr("May I have your attention, please?")
    
            function show(caption) {
                messageDialog.text = caption;
                messageDialog.open();
            }
        }
    }
    

    [edit: added missing coding tags ```SGaist]

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

      Hi and welcome to devnet,

      The exit action has special handling on OS X because it belongs to the menu item corresponding to your application name. The File menu should be beside it.

      Are you getting any error message on the console ?

      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
      • D Offline
        D Offline
        DooziiInc
        wrote on last edited by
        #3

        Thank you for your reply. No errors, no warnings... nothing during compile. I literally create the project and click run and the entire menu bar is simply not showing in the application provided/generated by QtCreator.

        Is this just a bug with QtCreator for this version or for all versions? Seems like I saw this behavior in QtQuick under QtCreator 5.4 as well, which was why I put it on hold for awhile hoping they were going to fix it.

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

          What version of OS X are you using ?

          Are you still experiencing the same with this lighter version of the code ?

          import QtQuick 2.5
          import QtQuick.Controls 1.4
          
          ApplicationWindow {
          visible: true
          width: 640
          height: 480
          title: qsTr("Hello World")
          
          menuBar: MenuBar {
              Menu {
                  title: qsTr("File")
                  MenuItem {
                      text: qsTr("&Open")
                      onTriggered: console.log("Open action triggered");
                  }
                  MenuItem {
                      text: qsTr("Exit")
                      onTriggered: Qt.quit();
                  }
              }
          }
          

          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
          • D Offline
            D Offline
            DooziiInc
            wrote on last edited by
            #5

            OS X 10.9.5

            And yes, I have even tried to use Qt 5.4 with the same result.

            1 Reply Last reply
            0
            • D Offline
              D Offline
              DooziiInc
              wrote on last edited by
              #6

              I went ahead and filed a bug at:
              https://bugreports.qt.io/browse/QTCREATORBUG-14958

              I verified this exists in older versions of QtCreator also

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

                Ok, I see the problem: you're looking for the menu at the wrong place.

                On OS X there's no such thing as menu bar on the main window itself: look at the top of the screen besides the apple top left, you'll see the application name which is the main menu where you'll find the exit action and beside it the File menu you added.

                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
                1
                • D Offline
                  D Offline
                  DooziiInc
                  wrote on last edited by
                  #8

                  Yep. That was totally the problem. Because I was compiling for Windows, Android and Mac OS X, I never even considered looking there and since the other two seemed to render, I thought something was broken on my machine or in the SDK. Thank you so much for your help!

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

                    You're welcome !

                    SInce everything is OK now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

                    Also, while browsing the forum, consider up-voting the answers that helped you, it will make them easier to find for other users :)

                    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

                    • Login

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