Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Installation and Deployment
  4. Compile QT 5.8 to cross-compile Beaglebone
Forum Updated to NodeBB v4.3 + New Features

Compile QT 5.8 to cross-compile Beaglebone

Scheduled Pinned Locked Moved Unsolved Installation and Deployment
53 Posts 5 Posters 31.5k 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.
  • jsulmJ jsulm

    @Andrey-Shmelew You're using a relative path:

    view.setSource(QUrl::fromLocalFile("main.qml"));
    

    Depending from where you start your app the file will not be found.
    You should construct an absolute path at runtime using http://doc.qt.io/qt-5/qcoreapplication.html#applicationDirPath

    A Offline
    A Offline
    Andrey Shmelew
    wrote on last edited by Andrey Shmelew
    #35

    @jsulm
    um, should i make something like this?

        QQuickView view;
        view.setSource(QUrl::fromLocalFile("C:/qtqml57/main.qml"));
        view.show();
    

    the output is still

    file:///C:/qtqml57/main.qml: File not found
    
    jsulmJ 1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #36

      Because that file is located on your Windows machine.

      If you don't want to put it in a Qt resource, then do as @jsulm suggested: build the path at run time.

      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
      • A Andrey Shmelew

        @jsulm
        um, should i make something like this?

            QQuickView view;
            view.setSource(QUrl::fromLocalFile("C:/qtqml57/main.qml"));
            view.show();
        

        the output is still

        file:///C:/qtqml57/main.qml: File not found
        
        jsulmJ Offline
        jsulmJ Offline
        jsulm
        Lifetime Qt Champion
        wrote on last edited by
        #37

        @Andrey-Shmelew Something like this:

        QString path = QCoreApplication::applicationDirPath() + '/' + "main.qml";
        QQuickView view;
        view.setSource(QUrl::fromLocalFile(path));
        view.show();
        

        https://forum.qt.io/topic/113070/qt-code-of-conduct

        A 1 Reply Last reply
        1
        • jsulmJ jsulm

          @Andrey-Shmelew Something like this:

          QString path = QCoreApplication::applicationDirPath() + '/' + "main.qml";
          QQuickView view;
          view.setSource(QUrl::fromLocalFile(path));
          view.show();
          
          A Offline
          A Offline
          Andrey Shmelew
          wrote on last edited by Andrey Shmelew
          #38

          @jsulm
          thanks, but it don't works for me

          file:///usr/main.qml: File not found
          

          note that when i deploy with qt 5.5 kit it enables to deploy without any path stuff

          so if i upload main.qml to beaglebone's /usr/ folder then i get :

          QQuickView only supports loading of root objects that derive from QQuickItem. 
          
          If your example is using QML 2, (such as qmlscene) and the .qml file you 
          loaded has 'import QtQuick 1.0' or 'import Qt 4.7', this error will occur. 
          
          To load files with 'import QtQuick 1.0' or 'import Qt 4.7', use the 
          QDeclarativeView class in the Qt Quick 1 module.
          
          jsulmJ 1 Reply Last reply
          0
          • A Andrey Shmelew

            @jsulm
            thanks, but it don't works for me

            file:///usr/main.qml: File not found
            

            note that when i deploy with qt 5.5 kit it enables to deploy without any path stuff

            so if i upload main.qml to beaglebone's /usr/ folder then i get :

            QQuickView only supports loading of root objects that derive from QQuickItem. 
            
            If your example is using QML 2, (such as qmlscene) and the .qml file you 
            loaded has 'import QtQuick 1.0' or 'import Qt 4.7', this error will occur. 
            
            To load files with 'import QtQuick 1.0' or 'import Qt 4.7', use the 
            QDeclarativeView class in the Qt Quick 1 module.
            
            jsulmJ Offline
            jsulmJ Offline
            jsulm
            Lifetime Qt Champion
            wrote on last edited by
            #39

            @Andrey-Shmelew "/usr"?!
            Where is you app located?

            https://forum.qt.io/topic/113070/qt-code-of-conduct

            A 1 Reply Last reply
            0
            • jsulmJ jsulm

              @Andrey-Shmelew "/usr"?!
              Where is you app located?

              A Offline
              A Offline
              Andrey Shmelew
              wrote on last edited by Andrey Shmelew
              #40

              @jsulm
              it is located in beaglebone's /usr folder when deployed.

              When i develop -main.qml is located on windows C:/qtqml57/main.qml ( qtqml57 is qt 5 project folder)

              jsulmJ 1 Reply Last reply
              0
              • A Andrey Shmelew

                @jsulm
                it is located in beaglebone's /usr folder when deployed.

                When i develop -main.qml is located on windows C:/qtqml57/main.qml ( qtqml57 is qt 5 project folder)

                jsulmJ Offline
                jsulmJ Offline
                jsulm
                Lifetime Qt Champion
                wrote on last edited by
                #41

                @Andrey-Shmelew Quite unusual location.
                Can you describe how the layout of your app is?
                Is it like this:

                /usr/YOUR_APP_EXECUTABLE
                /usr/main.qml
                

                ?

                https://forum.qt.io/topic/113070/qt-code-of-conduct

                A 1 Reply Last reply
                0
                • jsulmJ jsulm

                  @Andrey-Shmelew Quite unusual location.
                  Can you describe how the layout of your app is?
                  Is it like this:

                  /usr/YOUR_APP_EXECUTABLE
                  /usr/main.qml
                  

                  ?

                  A Offline
                  A Offline
                  Andrey Shmelew
                  wrote on last edited by Andrey Shmelew
                  #42

                  @jsulm
                  by default it is:

                  project:
                  windows 10, project path C:/qtqml57/

                  alt text

                  after rebuild it's deployed in Linux /usr/ directory

                  jsulmJ 1 Reply Last reply
                  0
                  • A Andrey Shmelew

                    @jsulm
                    by default it is:

                    project:
                    windows 10, project path C:/qtqml57/

                    alt text

                    after rebuild it's deployed in Linux /usr/ directory

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on last edited by
                    #43

                    @Andrey-Shmelew can you please show how it looks like in /usr? Is it like I asked above? So, how does the deploy directory (/usr in your case) look like?

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    A 1 Reply Last reply
                    0
                    • jsulmJ jsulm

                      @Andrey-Shmelew can you please show how it looks like in /usr? Is it like I asked above? So, how does the deploy directory (/usr in your case) look like?

                      A Offline
                      A Offline
                      Andrey Shmelew
                      wrote on last edited by Andrey Shmelew
                      #44

                      @jsulm

                      sorry for annoying

                      i just added to a .pro file as usual :

                      target.path  = /usr
                      INSTALLS    += target
                      DISTFILES +=
                      
                      

                      now on my beaglebone /usr/ folder looks like

                      alt text

                      jsulmJ 2 Replies Last reply
                      0
                      • A Andrey Shmelew

                        @jsulm

                        sorry for annoying

                        i just added to a .pro file as usual :

                        target.path  = /usr
                        INSTALLS    += target
                        DISTFILES +=
                        
                        

                        now on my beaglebone /usr/ folder looks like

                        alt text

                        jsulmJ Offline
                        jsulmJ Offline
                        jsulm
                        Lifetime Qt Champion
                        wrote on last edited by
                        #45

                        @Andrey-Shmelew You should really upload a bigger picture - it is nearly impossible to see anything. I tried hard but could not find main.qml file there. So, where is it?

                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                        A 1 Reply Last reply
                        0
                        • A Andrey Shmelew

                          @jsulm

                          sorry for annoying

                          i just added to a .pro file as usual :

                          target.path  = /usr
                          INSTALLS    += target
                          DISTFILES +=
                          
                          

                          now on my beaglebone /usr/ folder looks like

                          alt text

                          jsulmJ Offline
                          jsulmJ Offline
                          jsulm
                          Lifetime Qt Champion
                          wrote on last edited by
                          #46

                          @Andrey-Shmelew And you should not pollute /usr with files of your app. It is better to use /opt/YOUR_APP_NAME.

                          https://forum.qt.io/topic/113070/qt-code-of-conduct

                          1 Reply Last reply
                          0
                          • jsulmJ jsulm

                            @Andrey-Shmelew You should really upload a bigger picture - it is nearly impossible to see anything. I tried hard but could not find main.qml file there. So, where is it?

                            A Offline
                            A Offline
                            Andrey Shmelew
                            wrote on last edited by
                            #47

                            @jsulm

                            sorry about that, picture is really small

                            and there is no main.qml in /usr

                            jsulmJ 1 Reply Last reply
                            0
                            • A Andrey Shmelew

                              @jsulm

                              sorry about that, picture is really small

                              and there is no main.qml in /usr

                              jsulmJ Offline
                              jsulmJ Offline
                              jsulm
                              Lifetime Qt Champion
                              wrote on last edited by
                              #48

                              @Andrey-Shmelew That's why it is not working

                              https://forum.qt.io/topic/113070/qt-code-of-conduct

                              A 1 Reply Last reply
                              0
                              • jsulmJ jsulm

                                @Andrey-Shmelew That's why it is not working

                                A Offline
                                A Offline
                                Andrey Shmelew
                                wrote on last edited by
                                #49

                                @jsulm
                                so if i upload main.qml to beaglebone's /usr/ folder then i get :

                                QQuickView only supports loading of root objects that derive from QQuickItem.

                                If your example is using QML 2, (such as qmlscene) and the .qml file you
                                loaded has 'import QtQuick 1.0' or 'import Qt 4.7', this error will occur.

                                To load files with 'import QtQuick 1.0' or 'import Qt 4.7', use the
                                QDeclarativeView class in the Qt Quick 1 module.

                                jsulmJ 1 Reply Last reply
                                0
                                • A Andrey Shmelew

                                  @jsulm
                                  so if i upload main.qml to beaglebone's /usr/ folder then i get :

                                  QQuickView only supports loading of root objects that derive from QQuickItem.

                                  If your example is using QML 2, (such as qmlscene) and the .qml file you
                                  loaded has 'import QtQuick 1.0' or 'import Qt 4.7', this error will occur.

                                  To load files with 'import QtQuick 1.0' or 'import Qt 4.7', use the
                                  QDeclarativeView class in the Qt Quick 1 module.

                                  jsulmJ Offline
                                  jsulmJ Offline
                                  jsulm
                                  Lifetime Qt Champion
                                  wrote on last edited by
                                  #50

                                  @Andrey-Shmelew said in Compile QT 5.8 to cross-compile Beaglebone:

                                  QDeclarativeView

                                  It says what you should do: use QDeclarativeView instead of QQuickView

                                  https://forum.qt.io/topic/113070/qt-code-of-conduct

                                  A 1 Reply Last reply
                                  0
                                  • jsulmJ jsulm

                                    @Andrey-Shmelew said in Compile QT 5.8 to cross-compile Beaglebone:

                                    QDeclarativeView

                                    It says what you should do: use QDeclarativeView instead of QQuickView

                                    A Offline
                                    A Offline
                                    Andrey Shmelew
                                    wrote on last edited by
                                    #51
                                    This post is deleted!
                                    1 Reply Last reply
                                    0
                                    • A Offline
                                      A Offline
                                      Andrey Shmelew
                                      wrote on last edited by
                                      #52

                                      ok, i solved the problem:
                                      put manually main.qml into /usr/ folder

                                      main.cpp

                                      #include <QGuiApplication>
                                      #include <QQmlApplicationEngine>
                                      
                                      int main(int argc, char *argv[])
                                      {
                                          QGuiApplication app(argc, argv);
                                          QQmlApplicationEngine engine;
                                          engine.load(QUrl(QStringLiteral("/usr/main.qml")));
                                          return app.exec();
                                      }
                                      
                                      
                                      jsulmJ 1 Reply Last reply
                                      0
                                      • A Andrey Shmelew

                                        ok, i solved the problem:
                                        put manually main.qml into /usr/ folder

                                        main.cpp

                                        #include <QGuiApplication>
                                        #include <QQmlApplicationEngine>
                                        
                                        int main(int argc, char *argv[])
                                        {
                                            QGuiApplication app(argc, argv);
                                            QQmlApplicationEngine engine;
                                            engine.load(QUrl(QStringLiteral("/usr/main.qml")));
                                            return app.exec();
                                        }
                                        
                                        
                                        jsulmJ Offline
                                        jsulmJ Offline
                                        jsulm
                                        Lifetime Qt Champion
                                        wrote on last edited by
                                        #53

                                        @Andrey-Shmelew You should take a look at "Installing Files" in http://doc.qt.io/qt-5/qmake-advanced-usage.html to avoid manually copying the file. And you should construct the path at runtime, as I suggested before, else if you change the installation directory later you will need to change your code and rebuild the app.

                                        https://forum.qt.io/topic/113070/qt-code-of-conduct

                                        1 Reply Last reply
                                        2

                                        • Login

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