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. Mac Menus are not active ????
Forum Updated to NodeBB v4.3 + New Features

Mac Menus are not active ????

Scheduled Pinned Locked Moved Unsolved General and Desktop
40 Posts 7 Posters 9.1k Views 3 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.
  • N Offline
    N Offline
    Nevering
    wrote on last edited by
    #28

    is this a good reference, or is there a better one, this is from 4.8.

    http://doc.qt.io/qt-4.8/deployment-mac.html

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Rondog
      wrote on last edited by
      #29

      I ran a test and saw exactly what you described in this thread (Qt 5.6.0, OSX 10.10.5, XCode 7.2.1). I tried changing a few things here and there in the source to see if I could get it to work without success. Changes in the PRO file seemed to affect it.

      In the project file I remove this line:

      CONFIG -= app_bundle
      

      and replaced it with this:

      CONFIG +=release \
      		warn_on \
      		qt \
      		thread 
      

      It worked fine after this change for some reason.

      I didn't look into what the differences are in these options of the project file. These are common options I use for everything. Maybe try this and see if this works for you as well.

      I also tried converting the UI file into a set of cpp files (generic main.cpp, mainwindow.cpp, and mainwindow.h). It worked regardless of the above change in the PRO file.

      It looks like there is something odd going on but I am not sure what the source is. The project file supplied with this sample should be cleaned up regardless (maybe this is the underlying reason?). The project file from the CPP generated version is a little more complete so this could be a reason I didn't see this problem with the derived version and only with the UI version (?).

      N 1 Reply Last reply
      1
      • N Offline
        N Offline
        Nevering
        wrote on last edited by
        #30

        Someone please help me understand the problem. Why did CONFIG -= app_bundle cause the problem and removing fix it? The article linked above says that CONFIG -= app_bundle should be used for Macs .

        1 Reply Last reply
        0
        • R Rondog

          I ran a test and saw exactly what you described in this thread (Qt 5.6.0, OSX 10.10.5, XCode 7.2.1). I tried changing a few things here and there in the source to see if I could get it to work without success. Changes in the PRO file seemed to affect it.

          In the project file I remove this line:

          CONFIG -= app_bundle
          

          and replaced it with this:

          CONFIG +=release \
          		warn_on \
          		qt \
          		thread 
          

          It worked fine after this change for some reason.

          I didn't look into what the differences are in these options of the project file. These are common options I use for everything. Maybe try this and see if this works for you as well.

          I also tried converting the UI file into a set of cpp files (generic main.cpp, mainwindow.cpp, and mainwindow.h). It worked regardless of the above change in the PRO file.

          It looks like there is something odd going on but I am not sure what the source is. The project file supplied with this sample should be cleaned up regardless (maybe this is the underlying reason?). The project file from the CPP generated version is a little more complete so this could be a reason I didn't see this problem with the derived version and only with the UI version (?).

          N Offline
          N Offline
          Nevering
          wrote on last edited by
          #31

          @Rondog

          So the article that I linked says that CONFIG -= app_bundle is needed on Mac.. Is this not the case ? Is there any more recent documentation on how to build the bundle within Qt?

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

            You misunderstood the documentation. As stated just about the code snippet, the CONFIG -= app_bundle line applies only to command line tools.

            Otherwise, use a bundle. macOS looks for information in that bundle: the Info.plist file being the central point of interest. Qt generates one for you automatically with sensible defaults.

            Depending on what feature you'll be using, you will have to provide your own file.

            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
            • N Offline
              N Offline
              Nevering
              wrote on last edited by
              #33

              Trying to find out more, but I don't see any info.plist created with any of my projects built on my Mac.

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

                Where did you look for it ?

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

                N 1 Reply Last reply
                0
                • SGaistS SGaist

                  Where did you look for it ?

                  N Offline
                  N Offline
                  Nevering
                  wrote on last edited by
                  #35

                  @SGaist

                  I saw it in the Mac documentation.. And I did a search on my Mac. There doesnt' seem to be any related info.plist file generated in the local folder. However there are some on the system and in the Qt example folder. Still trying to figure this out, documentation on this would really help ...

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

                    The Info.plist file can be found in ./your_application_name.app/Contents/.

                    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
                    • N Offline
                      N Offline
                      Nevering
                      wrote on last edited by
                      #37

                      Are you saying it's inside the .app file ? Other info.plist that I have seperate files, for example in the one in Examples/Qt-5.7/sensors/accelbubble.

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

                        Yes it is.

                        When you see an Info.plist file in an example sources or another project it's because it has been customized. You can check in the .pro file and you'll find line stating that it's the one that should be used and which will be copied into the bundle.

                        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
                        • N Nevering

                          Are you saying it's inside the .app file ? Other info.plist that I have seperate files, for example in the one in Examples/Qt-5.7/sensors/accelbubble.

                          K Offline
                          K Offline
                          kenchan
                          wrote on last edited by kenchan
                          #39

                          @Nevering
                          It looks like you need to read up on the Mac docs about how prepare an app for deployment. A .app file is just a directory with a special name that the mac understands and expects to contain certain files and directories. Just open one up and take look inside you will see. You will find the rules in the mac documentation.
                          if you have XCode or access to the apple developer site you might look at [this]
                          (https://developer.apple.com/library/content/documentation/CoreFoundation/Conceptual/CFBundles/Introduction/Introduction.html#//apple_ref/doc/uid/10000123i)

                          The macdeployqt tool will build one for your app and you can modify it to suit your needs. The document you linked in you previous post tells you how to do that.

                          Good luck

                          1 Reply Last reply
                          3
                          • R Offline
                            R Offline
                            remik
                            wrote on last edited by
                            #40

                            I've had a similar bad experience since 5.7 on macos 10.11 and now 10.12. I too have to focus to another app after the qt application starts. If I don't, the push buttons are not clickable, and even a native mac file dialog won't allow me to select files, though the scrollers work (I invoke the dialog with a shortcut). This applies to running the app from qtcreator, however, when run from terminal or a proper .app bundle, it works as expected.

                            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