macdeployqt: app launches but there is no window



  • 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();
    }
    


  • 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!


  • Lifetime Qt Champion

    Hi,

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



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


  • Lifetime Qt Champion

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



  • @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.


  • Lifetime Qt Champion

    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.



  • @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?


  • Lifetime Qt Champion

    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.



  • @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?


  • Lifetime Qt Champion

    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.


  • Qt Champions 2016

    @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.



  • @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... ;-)


  • Lifetime Qt Champion

    What is still confusing ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.