cross compiling qt in raspberry pi



  • 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


  • Moderators

    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?



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


  • Moderators

    Hi Amruz,

    Did you try to set your application window maximized?



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


  • Moderators

    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



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


  • Moderators

    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.



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


  • Moderators

    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.



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


  • Moderators

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

    I hope someone else can help you.



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



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



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



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



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



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


Log in to reply
 

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