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. macdeployqt: app launches but there is no window
QtWS25 Last Chance

macdeployqt: app launches but there is no window

Scheduled Pinned Locked Moved Solved QML and Qt Quick
macdeployqt
14 Posts 4 Posters 4.6k 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.
  • T Offline
    T Offline
    TOMATO_QT
    wrote on 8 Feb 2016, 02:33 last edited by
    #1

    Yes...yet another macdeployqt question. I sifted through all the previous ones but did not see a relevant answer.

    With a completely vanilla app (below) I use macdeployqt to bundle the dependencies. The resulting app will launch but there is no window and no menubar. I vaguely recall running into this before but can't recall the solution.

    macdeployqt give no errors and the app plumps up in filesize as one would expect.

    My o my o my.... whatever could be wrong ... little help?
    (why doesn't Qt Creator have an option/wizard to just "Deploy"?)

    main.qml

    import QtQuick 2.3
    import QtQuick.Controls 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();
                }
            }
        }
    
        Label {
            text: qsTr("Hello World")
            anchors.centerIn: parent
        }
    }
    

    main.cpp

    #include <QApplication>
    #include <QQmlApplicationEngine>
    
    int main(int argc, char *argv[])
    {
        QApplication app(argc, argv);
    
        QQmlApplicationEngine engine;
        engine.load(QUrl(QStringLiteral("qrc:/main.qml")));
    
        return app.exec();
    }
    
    1 Reply Last reply
    0
    • F Offline
      F Offline
      Frime
      wrote on 8 Feb 2016, 10:20 last edited by
      #2

      Hi,

      Try to run the app in terminal, that should give you more information about missing dependencies. Sometimes it's necessary to copy additional libraries / QML Plugins manually. macdeployqt isn't very reliable (;

      Good luck!

      1 Reply Last reply
      0
      • S Offline
        S Offline
        SGaist
        Lifetime Qt Champion
        wrote on 8 Feb 2016, 10:38 last edited by
        #3

        Hi,

        What parameter did you give to macdeployqt ? Did you give it the path to your qml files to check for dependencies ?

        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
        • T Offline
          T Offline
          TOMATO_QT
          wrote on 8 Feb 2016, 15:51 last edited by
          #4

          So... I forgot about qmldir and how to use it.

          1 Reply Last reply
          0
          • S Offline
            S Offline
            SGaist
            Lifetime Qt Champion
            wrote on 9 Feb 2016, 21:35 last edited by
            #5

            Do you mean that was it or is it still not working ?

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

            T 1 Reply Last reply 9 Feb 2016, 21:42
            0
            • S SGaist
              9 Feb 2016, 21:35

              Do you mean that was it or is it still not working ?

              T Offline
              T Offline
              TOMATO_QT
              wrote on 9 Feb 2016, 21:42 last edited by TOMATO_QT 2 Sept 2016, 21:42
              #6

              @SGaist

              Yeah, that was it: not specifying/then incorrectly specifying the qmldir.

              I am surprised someone (or the folks at Qt) hasn't created a front end "wizard" for the whole "deploy" thing - including the "static vs dynamic" linking thing. I assume that since my app plumped up that the libs are bundled and statically linked.

              Oh - and what's up with our icons? You're blue now. I'm red.

              1 Reply Last reply
              0
              • S Offline
                S Offline
                SGaist
                Lifetime Qt Champion
                wrote on 9 Feb 2016, 22:02 last edited by
                #7

                It's the missing frameworks that have been pulled in and unless you have built your own version of Qt, no static linking occurs (it also has licensing implication).

                OS X is pretty much the only platform where the packaging of an application has been standardized with some tools available for that.

                Forum update, plugin update, if you used gravatar, you may need to reselect it on your profile.

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

                T 1 Reply Last reply 10 Feb 2016, 20:17
                0
                • S SGaist
                  9 Feb 2016, 22:02

                  It's the missing frameworks that have been pulled in and unless you have built your own version of Qt, no static linking occurs (it also has licensing implication).

                  OS X is pretty much the only platform where the packaging of an application has been standardized with some tools available for that.

                  Forum update, plugin update, if you used gravatar, you may need to reselect it on your profile.

                  T Offline
                  T Offline
                  TOMATO_QT
                  wrote on 10 Feb 2016, 20:17 last edited by TOMATO_QT 2 Oct 2016, 20:17
                  #8

                  @SGaist

                  It's the missing frameworks that have been pulled in and unless you have built your own version of Qt, no static linking occurs (it also has licensing implication).

                  Hmm... maybe I am missing something fundamental.

                  So If I gave the app resulting from using macdeployqt to someone, they would NOT be able to run it without installing Qt?

                  The app plumped up to 35mb. Are you saying that that is just headers?

                  1 Reply Last reply
                  0
                  • S Offline
                    S Offline
                    SGaist
                    Lifetime Qt Champion
                    wrote on 10 Feb 2016, 20:25 last edited by
                    #9

                    No, that would defeat the purpose of macdeployqt. Like I wrote, its job is to pull into the application bundle the non-system dependencies so that you can start the application without installing anything.

                    No, I'm not saying that. OS X's framework are not just headers, they contains also the libraries and resources needed to be used. The 35MB are Qt's frameworks/Plugins/qml stuff.

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

                    T 1 Reply Last reply 10 Feb 2016, 20:32
                    0
                    • S SGaist
                      10 Feb 2016, 20:25

                      No, that would defeat the purpose of macdeployqt. Like I wrote, its job is to pull into the application bundle the non-system dependencies so that you can start the application without installing anything.

                      No, I'm not saying that. OS X's framework are not just headers, they contains also the libraries and resources needed to be used. The 35MB are Qt's frameworks/Plugins/qml stuff.

                      T Offline
                      T Offline
                      TOMATO_QT
                      wrote on 10 Feb 2016, 20:32 last edited by TOMATO_QT 2 Oct 2016, 20:33
                      #10

                      @SGaist

                      Thanks. Sorry to belabor this....but I guess I don't understand static linking – I thought that meant bundling the needed runtime resources into the app (which you say macdeployqt is doing) compared to dynamic linking which requires the Qt libs to be installed on the machine as a system resource.

                      So is macdeployqt statically linking?

                      K 1 Reply Last reply 10 Feb 2016, 20:44
                      0
                      • S Offline
                        S Offline
                        SGaist
                        Lifetime Qt Champion
                        wrote on 10 Feb 2016, 20:44 last edited by
                        #11

                        macdeployqt only role is to check the dependencies of your application, copy them at the right place in the application bundle, do some reconfiguration on the dynamic libraries and the application executable so that the dependencies are looked for at the correct place.

                        That's all, macdeployqt is not a linker.

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

                        T 1 Reply Last reply 11 Feb 2016, 03:11
                        1
                        • T TOMATO_QT
                          10 Feb 2016, 20:32

                          @SGaist

                          Thanks. Sorry to belabor this....but I guess I don't understand static linking – I thought that meant bundling the needed runtime resources into the app (which you say macdeployqt is doing) compared to dynamic linking which requires the Qt libs to be installed on the machine as a system resource.

                          So is macdeployqt statically linking?

                          K Offline
                          K Offline
                          kshegunov
                          Moderators
                          wrote on 10 Feb 2016, 20:44 last edited by
                          #12

                          @TOMATO_QT

                          I thought that meant bundling the needed runtime resources into the app (which you say macdeployqt is doing) compared to dynamic linking which requires the Qt libs to be installed on the machine as a system resource.

                          Dynamic linking requires no such thing. Linking is the process of resolution of symbols and has nothing to do with bundling up of binaries.

                          Read and abide by the Qt Code of Conduct

                          1 Reply Last reply
                          0
                          • S SGaist
                            10 Feb 2016, 20:44

                            macdeployqt only role is to check the dependencies of your application, copy them at the right place in the application bundle, do some reconfiguration on the dynamic libraries and the application executable so that the dependencies are looked for at the correct place.

                            That's all, macdeployqt is not a linker.

                            T Offline
                            T Offline
                            TOMATO_QT
                            wrote on 11 Feb 2016, 03:11 last edited by
                            #13

                            @SGaist

                            Still so confused...

                            Wouldn't it be great if some kind Qt Champion wrote a little article for the wiki?
                            I would help...by asking the dumb questions.

                            Doubly awesome would be a front end to macdeployqt. I almost know enough now to write it myself (even if I don't fully understand what it does... ;-)

                            1 Reply Last reply
                            0
                            • S Offline
                              S Offline
                              SGaist
                              Lifetime Qt Champion
                              wrote on 11 Feb 2016, 20:51 last edited by
                              #14

                              What is still confusing ?

                              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

                              9/14

                              10 Feb 2016, 20:25

                              • Login

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