What is the use of various Qt platform plugins?
cross-platform, linux, plugins, qt, qt5
Solution
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 using the `-platform <plugin>` option, you can either pass the default one to `configure` when you build Qt, or override the built-in default with exporting `QT_QPA_PLATFORM=<plugin>`.
The plugins can be described as follows:
Linux plugins - those use Linux-specific input devices and various output devices
wayland (since Qt 5.11) - Allows to run Qt applications on Wayland display servers.
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.
Problem
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)