0

I'm very new to Qt. I want to start developing GUI Qt application in C++ on raspberry pi. I want to start this application in Kiosk mode on boot. I manage to do it, but I encounter the following problem:

When I start the compiled application on the desktop environment it looks fine:

enter image description here

However, the things are getting wired when I execute it on the terminal "sudo ./untitled" :

enter image description here

The same happens when I start X and within that X I start the application.

I have tried to start it without X using this guide https://wiki.qt.io/RaspberryPi2EGLFS

Nothing so far.

Maybe I need to start X session, in a very different way, including some libs?

  • When you run it in the first screenshot, it's being run as user 'pi'. In the second screenshot, you use sudo so it is being run as user 'root'. Looks like the GUI settings for root need to be changed to use the same UI settings as the pi account has. – Phil B. Oct 30 '16 at 13:21
  • I start X + QT application using this raspberrypi.org/forums/viewtopic.php?p=344408 – Angel Oct 30 '16 at 13:52
1

You have two* different options when launching a QT program on RasPi, you can either run it on the EGLFS (Extended Graphics Library Full Screen) platform which is the default platform your program will run from when you launch it from command line. This is what you are seeing in the second image.

Alternatively you can run it on the XCB (X C Bindings) platform which is what executing it from the file browser will default to, which is seen in the first image.

To run your program in XCB from command line type:

$./my_qt_program -platform xcb

Old question but hope this helps somebody....

*EDIT: I think two is probably a lie but they are the only two I have come across and are the two different platforms shown in your images

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.