Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the use of various Qt platform plugins?

I was doing some cross compiling of a Qt5.2 application for an ARM based target (TI AM335x EVM) and it was failing to display anything on my platform. After doing some google’ing I found that if I launched it with:

 ./helloworld -platform eglfs

it would show up (full screen, but it worked)!

I started looking at all the platform options, I found:

android, eglfs, linuxfb, minimalegl, windows, xcb, cocoa, ios, offscreen, qnx, directfp, kms, minimal, openwfd

I’m wondering what they are for. I assume, for example, that if I wanted to run my application on an Android device I’d have to pass -platform android, but they’re not all obvious to me.

Is there a listing anywhere of when each of these parameters should be used?

For example, what does eglfs stand for? And why did I need to use that where as linuxfb didn’t work?
(I would have thought the linux frame buffer was how I wanted to launch my application since it was running on embedded linux)

like image 747
Mike Avatar asked Jan 31 '14 19:01

Mike


4 Answers

If the linuxfb plugin doesn't work, then possibly you didn't correctly configure the framebuffer device on your system. Maybe a directf layer is already running, so you may want to try the directfb plugin instead.

If you wish to avoid having to specify the platform option when you run the executable, you can pass the default one to configure when you build Qt.

The plugins can be described as follows:

  • Linux plugins - those use Linux-specific input devices and various output devices

  • eglfs - Uses the OpenGL ES in fullscreen mode. There's no other way since OpenGL has no concept of a window manager.

  • directfb (not directfp) - Uses the linux frame buffer with OpenGL ES via the directfb layer (see also wikipedia). Integrates into the directfb windowing.

  • linuxfb - Uses the linux frame buffer in fullscreen mode. There's no other way since linuxfb has no concept of a window manager.

  • kms - Uses linux kernel modesetting API in fullscreen mode. There's no other way since DRM has no concept of a window manager.

  • openwfd - Uses an openwfd Wifi display in fullscreen mode. There's no other way since openwfd has no concept of a window manager.

  • Platform-independent plugins - could be made to run on any OS

  • xcb - Runs on an X11 server and is integrated into the X11 windowing environment. Generally it won't behave correctly without a window manager running as well. Can be made to work on Windows, given a Windows implementation of xlib, if you want to, say, serve applications from a Windows server to X11 thin terminals (typically Unix boxes).

  • offscreen - Renders to an offscreen buffer. Useful for rendering to custom displays.

  • minimal - A minimalistic backing store that optionally dumps the virtual screen to a file. Implements the bare minimum of functionality just to demonstrate how to start writing a platform plugin.

  • Other platform-specific plugins

  • android - Uses the Android APIs and is integrated into the Android environment.

  • windows - Uses the WINAPI and is integrated into the Windows windowing environment.

  • cocoa - Uses the Cocoa APIs and is integrated into the OS X windowing environment.

  • iOS - Uses the iOS toolkits and is integrated into the iOS environment.

  • qnx - Uses the QNX APIs and is integrated into the QNX photon windowing environment.

like image 103
Kuba hasn't forgotten Monica Avatar answered Sep 23 '22 16:09

Kuba hasn't forgotten Monica


I just replied in the TI forums to the same query. If eglfs is functional and linuxfb is not, please file a bug in JIRA with qt-project.org, as both eglfs and linuxfb in AM335x use the linux framebuffer. eglfs (when used with a widget application) uses dirty-rectangle approach with a fullscreen display. Also move to QML if possible when on Qt5.

PS: you can export QT_QPA_PLATFORM=eglfs (or linuxfb) on the target to avoid setting the platform everytime you invoke the application. (http://doc.qt.io/qt-5/embedded-linux.html)

like image 27
Prabindh Avatar answered Sep 23 '22 16:09

Prabindh


If the linuxfb plugin doesn't work, then possibly you didn't correctly configure the framebuffer device on your system. Maybe a directf layer is already running, so you may want to try the directfb plugin instead.

If you wish to avoid having to specify the platform option when you run the executable, you can pass the default one to configure when you build Qt.

The plugins can be described as follows:

  • Linux plugins - those use Linux-specific input devices and various output devices

  • eglfs - Uses the OpenGL ES in fullscreen mode. There's no other way since OpenGL has no concept of a window manager.

  • directfb (not directfp) - Uses the linux frame buffer with OpenGL ES via the directfb layer (see also wikipedia). Integrates into the directfb windowing.

  • linuxfb - Uses the linux frame buffer in fullscreen mode. There's no other way since linuxfb has no concept of a window manager.

  • kms - Uses linux kernel modesetting API in fullscreen mode. There's no other way since DRM has no concept of a window manager.

  • openwfd - Uses an openwfd Wifi display in fullscreen mode. There's no other way since openwfd has no concept of a window manager.

  • Platform-independent plugins - could be made to run on any OS

  • xcb - Runs on an X11 server and is integrated into the X11 windowing environment. Generally it won't behave correctly without a window manager running as well. Can be made to work on Windows, given a Windows implementation of xlib, if you want to, say, serve applications from a Windows server to X11 thin terminals (typically Unix boxes).

  • offscreen - Renders to an offscreen buffer. Useful for rendering to custom displays.

  • minimal - A minimalistic backing store that optionally dumps the virtual screen to a file. Implements the bare minimum of functionality just to demonstrate how to start writing a platform plugin.

  • Other platform-specific plugins

  • android - Uses the Android APIs and is integrated into the Android environment.

  • windows - Uses the WINAPI and is integrated into the Windows windowing environment.

  • cocoa - Uses the Cocoa APIs and is integrated into the OS X windowing environment.

  • iOS - Uses the iOS toolkits and is integrated into the iOS environment.

  • qnx - Uses the QNX APIs and is integrated into the QNX photon windowing environment.

like image 31
3 revs Avatar answered Sep 23 '22 16:09

3 revs


Probably the most noteworthy addition since the accepted answer was written is Qt's wayland platform, apparently since Qt 5.11 (in official binaries). Enabled now by default on Fedora 31+... which can be a little troublesome for some apps. Red Hat had to implement a fallback list.

like image 23
Fizz Avatar answered Sep 23 '22 16:09

Fizz