Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Game Development
  4. [Solved] Static qml app shows only white window.
Forum Updated to NodeBB v4.3 + New Features

[Solved] Static qml app shows only white window.

Scheduled Pinned Locked Moved Game Development
10 Posts 3 Posters 5.7k Views 1 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.
  • B Offline
    B Offline
    Busta Bug
    wrote on last edited by
    #1

    I have finished a game. I've used QML. there is a lot of qml, 2 js and 100 png files. My app is running regularly in qt creator when F5 pressed. But when I try make clean with "qmake -static -release", my app.exe just showing big white window. By the way, I have already added "CONFIG += staticlib" to my app.pro file. I have also built qt and my other qt apps staticly. I even have shared them with my friends. But I cant build static my qml apps. I try open a new qml project and build the qt qml beginner "hello world" app staticly. I show the same issue.
    A little thing, all my static qml app.exe files are ~12 mb, why?

    1 Reply Last reply
    0
    • V Offline
      V Offline
      vsorokin
      wrote on last edited by
      #2

      Seems like app can't find qml files. Try move your qml files in app's resources and used it from there.

      [quote author="Busta Bug" date="1317744776"]A little thing, all my static qml app.exe files are ~12 mb, why?[/quote]

      Because QtGui, QtCore and QtDeclarative libs placed into your exe file now.

      --
      Vasiliy

      1 Reply Last reply
      0
      • B Offline
        B Offline
        Busta Bug
        wrote on last edited by
        #3

        Sorry, How do you can it? I added a resource file to my pro. And added main.qml I tried use it in main.cpp but not found main.qml.

        viewer.setMainQmlFile(QLatin1String(":/qml/nm/main.qml"));
        or
        ("qrc:/qml/nm/main.qml"));
        or
        ("qrc:/main.qml"));
        even or
        (":/main.qml"));

        but not run

        what can I do?

        1 Reply Last reply
        0
        • V Offline
          V Offline
          vsorokin
          wrote on last edited by
          #4

          When you adding qml files to qrc you should set preffix. What do preffix you set?

          --
          Vasiliy

          1 Reply Last reply
          0
          • B Offline
            B Offline
            Busta Bug
            wrote on last edited by
            #5

            "/" like it

            1 Reply Last reply
            0
            • B Offline
              B Offline
              Busta Bug
              wrote on last edited by
              #6

              the prefix is "/", But Not running, just a white wiindow.

              1 Reply Last reply
              0
              • V Offline
                V Offline
                vsorokin
                wrote on last edited by
                #7
                1. use “qrc:/main.qml”
                2. Open your qmlapplicationviewer.cpp file
                3. Find method @void QmlApplicationViewer::setMainQmlFile(const QString &file)@
                4. Find line with @d->view->setSource(QUrl::fromLocalFile(d->mainQmlFile));@
                5. Change this line: @d->view->setSource(QUrl(d->mainQmlFile));@

                --
                Vasiliy

                1 Reply Last reply
                0
                • B Offline
                  B Offline
                  Busta Bug
                  wrote on last edited by
                  #8

                  Yes I got it .I just have built staticly.It is finished.Where do I share its hotfile link to show other qt devs?
                  Very very thanks!!!

                  1 Reply Last reply
                  0
                  • V Offline
                    V Offline
                    vsorokin
                    wrote on last edited by
                    #9

                    We have "Showcase":http://developer.qt.nokia.com/forums/viewforum/8/ section on this forum, you can create topic with link on your app there.

                    --
                    Vasiliy

                    1 Reply Last reply
                    0
                    • M Offline
                      M Offline
                      mlong
                      wrote on last edited by
                      #10

                      Be sure and edit your post title to add [Solved] at the beginning. Thanks!

                      Software Engineer
                      My views and opinions do not necessarily reflect those of anyone -- living or dead, real or fictional -- in this universe or any other similar multiverse node. Void where prohibited. Your mileage may vary. Caveat emptor.

                      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