Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Special Interest Groups
  3. QtonPi
  4. cross compiling qt in raspberry pi
Forum Updated to NodeBB v4.3 + New Features

cross compiling qt in raspberry pi

Scheduled Pinned Locked Moved Unsolved QtonPi
18 Posts 3 Posters 7.1k Views 2 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.
  • A Offline
    A Offline
    amruz
    wrote on last edited by amruz
    #1

    Hello all

    I need to use qt in raspberry pi without x11.
    So I am trying to cross compile qt in raspberry pi following the guidelines in

    https://www.ics.com/blog/configuring-qt-creator-raspberry-pi

    https://wiki.qt.io/RaspberryPi2EGLFS

    I configured the qt and build it. But when i am trying to run it is showing error as follows and no output screen is getting displayed in raspberry pi.(pi2)

    Unable to query physical screen size, defaulting to 100 dpi.
    To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).

    I added in .bashrc the following lines to avoid the error

    export QT_QPA_EGLFS_PHYSICAL_WIDTH=154
    export QT_QPA_EGLFS_PHYSICAL_HEIGHT=86
    export QT_QPA_EGLFS_WIDTH=800
    export QT_QPA_EGLFS_HEIGHT=480

    But after doing this also i am getting the same error.
    Can anyone help me with this...

    Thanks in advance

    1 Reply Last reply
    0
    • EddyE Offline
      EddyE Offline
      Eddy
      wrote on last edited by
      #2
      Unable to query physical screen size, defaulting to 100 dpi.
      

      I remember this error. AFAIR I could solve it by setting my application to maximum size.
      I will have to dig to find how I did it exactly. Are you compiling a QML application?

      Qt Certified Specialist
      www.edalsolutions.be

      A 1 Reply Last reply
      0
      • EddyE Eddy
        Unable to query physical screen size, defaulting to 100 dpi.
        

        I remember this error. AFAIR I could solve it by setting my application to maximum size.
        I will have to dig to find how I did it exactly. Are you compiling a QML application?

        A Offline
        A Offline
        amruz
        wrote on last edited by amruz
        #3

        @Eddy I am compiling a widget application
        I am stuck with this error for more than one week.. tried many possibilities :(

        1 Reply Last reply
        0
        • EddyE Offline
          EddyE Offline
          Eddy
          wrote on last edited by
          #4

          Hi Amruz,

          Did you try to set your application window maximized?

          Qt Certified Specialist
          www.edalsolutions.be

          A 1 Reply Last reply
          0
          • EddyE Eddy

            Hi Amruz,

            Did you try to set your application window maximized?

            A Offline
            A Offline
            amruz
            wrote on last edited by amruz
            #5

            @Eddy by maximized u meant setting the window to its default maximum size right?
            I tried with that also
            the weird thing is after showing this error also the application is still running but no output ..its idle..i couldnt understand what exactly is going on

            1 Reply Last reply
            0
            • EddyE Offline
              EddyE Offline
              Eddy
              wrote on last edited by Eddy
              #6

              With a QML based application I used :

              #include <QtGui/QGuiApplication>
              #include "qtquick2applicationviewer.h"
              
              int main(int argc, char *argv[])
              {
                  QGuiApplication app(argc, argv);
              
                  QtQuick2ApplicationViewer viewer;
                  viewer.setMainQmlFile(QStringLiteral("qml/mynoteapp/main.qml"));
                  viewer.showExpanded();// <- this one does the trick
              
                  return app.exec();
              }
              

              I remember succeeding with a widget based application also, so try showMaximized or showFullScreen

              Qt Certified Specialist
              www.edalsolutions.be

              A 1 Reply Last reply
              0
              • EddyE Eddy

                With a QML based application I used :

                #include <QtGui/QGuiApplication>
                #include "qtquick2applicationviewer.h"
                
                int main(int argc, char *argv[])
                {
                    QGuiApplication app(argc, argv);
                
                    QtQuick2ApplicationViewer viewer;
                    viewer.setMainQmlFile(QStringLiteral("qml/mynoteapp/main.qml"));
                    viewer.showExpanded();// <- this one does the trick
                
                    return app.exec();
                }
                

                I remember succeeding with a widget based application also, so try showMaximized or showFullScreen

                A Offline
                A Offline
                amruz
                wrote on last edited by
                #7

                @Eddy thx for the reply..
                ya tried that also..
                no luck.. :(

                1 Reply Last reply
                0
                • EddyE Offline
                  EddyE Offline
                  Eddy
                  wrote on last edited by
                  #8
                  the weird thing is after showing this error also the application is still running but no output ..its idle..i couldnt understand what exactly is going on
                  

                  By giving it a maximized size we force it to show on the screen.

                  Qt Certified Specialist
                  www.edalsolutions.be

                  A 1 Reply Last reply
                  0
                  • EddyE Eddy
                    the weird thing is after showing this error also the application is still running but no output ..its idle..i couldnt understand what exactly is going on
                    

                    By giving it a maximized size we force it to show on the screen.

                    A Offline
                    A Offline
                    amruz
                    wrote on last edited by
                    #9

                    @Eddy is it really with the problem of sizing or does it have anything to deal with the problem of compiling without x11?
                    after giving showfullscreen also the same error is coming and no output display in the raspberry pi

                    1 Reply Last reply
                    0
                    • EddyE Offline
                      EddyE Offline
                      Eddy
                      wrote on last edited by
                      #10
                      does it have anything to deal with the problem of compiling without x11?
                      

                      It depends. I suppose your sysroot is ok and you can mount the pi, something like this?

                      sudo mount -o loop,offset=62914560 /home/eddy/opt/raspberry-working-image.img /mnt/rasp-pi-rootfs
                      

                      How do you know the program is running on your Pi? How do you start it?
                      What Pi version are you using?
                      Could be good to show us all the details. Maybe someone that used the Pi recently can help out.

                      Qt Certified Specialist
                      www.edalsolutions.be

                      A 1 Reply Last reply
                      0
                      • EddyE Eddy
                        does it have anything to deal with the problem of compiling without x11?
                        

                        It depends. I suppose your sysroot is ok and you can mount the pi, something like this?

                        sudo mount -o loop,offset=62914560 /home/eddy/opt/raspberry-working-image.img /mnt/rasp-pi-rootfs
                        

                        How do you know the program is running on your Pi? How do you start it?
                        What Pi version are you using?
                        Could be good to show us all the details. Maybe someone that used the Pi recently can help out.

                        A Offline
                        A Offline
                        amruz
                        wrote on last edited by amruz
                        #11

                        @Eddy i am using pi2 touch screen. I am running the program in the command line itself without using startx.

                        when i login using the username and password in pi and then i run the program ./programname
                        it is showing the "unable to query physical size..." and nothing happens. the cursor blinks there till i stop running my program in my laptop

                        1 Reply Last reply
                        0
                        • EddyE Offline
                          EddyE Offline
                          Eddy
                          wrote on last edited by
                          #12

                          @amruz
                          I'm sorry, but I'm out of ideas.

                          I hope someone else can help you.

                          Qt Certified Specialist
                          www.edalsolutions.be

                          A 2 Replies Last reply
                          0
                          • EddyE Eddy

                            @amruz
                            I'm sorry, but I'm out of ideas.

                            I hope someone else can help you.

                            A Offline
                            A Offline
                            amruz
                            wrote on last edited by
                            #13

                            @Eddy thanks for the reply..
                            i also hope so

                            1 Reply Last reply
                            0
                            • EddyE Eddy

                              @amruz
                              I'm sorry, but I'm out of ideas.

                              I hope someone else can help you.

                              A Offline
                              A Offline
                              amruz
                              wrote on last edited by amruz
                              #14

                              @Eddy while debugging i am getting this message and the hour glass is just keeping on running

                              Debugging starts
                              Listening on port 10000
                              Remote debugging from host 192.168.15.128
                              Process /home/pi/qtinpitry created; pid = 925
                              File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
                              Unable to query physical screen size, defaulting to 100 dpi.
                              To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).

                              i have a doubt.. this message says that the file transfer is too slow. Is it because of this reason that i am not getting the widget display in raspberry pi?
                              Any suggestions on solving this problem?

                              H 1 Reply Last reply
                              0
                              • A amruz

                                @Eddy while debugging i am getting this message and the hour glass is just keeping on running

                                Debugging starts
                                Listening on port 10000
                                Remote debugging from host 192.168.15.128
                                Process /home/pi/qtinpitry created; pid = 925
                                File transfers from remote targets can be slow. Use "set sysroot" to access files locally instead.
                                Unable to query physical screen size, defaulting to 100 dpi.
                                To override, set QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT (in millimeters).

                                i have a doubt.. this message says that the file transfer is too slow. Is it because of this reason that i am not getting the widget display in raspberry pi?
                                Any suggestions on solving this problem?

                                H Offline
                                H Offline
                                hardikh
                                wrote on last edited by
                                #15

                                @amruz I am having same issue ....following qtrpi.com instruction... did u find any solution

                                A 1 Reply Last reply
                                0
                                • H hardikh

                                  @amruz I am having same issue ....following qtrpi.com instruction... did u find any solution

                                  A Offline
                                  A Offline
                                  amruz
                                  wrote on last edited by
                                  #16

                                  @hardikh not yet..kindly post here if u get the solution..

                                  H 1 Reply Last reply
                                  0
                                  • A amruz

                                    @hardikh not yet..kindly post here if u get the solution..

                                    H Offline
                                    H Offline
                                    hardikh
                                    wrote on last edited by
                                    #17

                                    @amruz yes did work just few minutes before able to do run qopenglwidget on raspberry pi my hdmi screen FHD and able to set resolution and screen size as suited for raspberry pin 7 inch screen followed https://wiki.qt.io/RaspberryPi2EGLFS and http://www.bytran.org/qtrpicrosscompile.htm now will install more module to qt than setup creator on ubuntu

                                    A 1 Reply Last reply
                                    0
                                    • H hardikh

                                      @amruz yes did work just few minutes before able to do run qopenglwidget on raspberry pi my hdmi screen FHD and able to set resolution and screen size as suited for raspberry pin 7 inch screen followed https://wiki.qt.io/RaspberryPi2EGLFS and http://www.bytran.org/qtrpicrosscompile.htm now will install more module to qt than setup creator on ubuntu

                                      A Offline
                                      A Offline
                                      amruz
                                      wrote on last edited by amruz
                                      #18

                                      @hardikh i actually followed the wiki page and the blog for cross compiling qt..still i am facing this error..does setting the physical height and width solved the problem?

                                      i tried by setting the QT_QPA_EGLFS_PHYSICAL_WIDTH and QT_QPA_EGLFS_PHYSICAL_HEIGHT in .bashrc but no change

                                      can you mention what steps you followed for correcting it

                                      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