In a desktop PC, running a QT application is straight forward, just compile the application then execute it. So you will not notice the behind the scene tasks done.
To run Qt Linux applications, we must first start one process to act as a GUI server. Most of the Linux distributions run X11 as the default GUI server. X11 runs in the background. Once the X11 is started it takes care of framebuffer (the memory area associated with the video display) and becomes a server. The server is responsible for allocating screen regions to clients and for generating mouse and keyboard events.
When you launch a GUI application (client), the client applications communicate with the GUI server using shared memory and Unix pipes. The clients draw themselves into the Linux framebuffer and are responsible for painting their own window decorations, etc.
But in embedded such as mobile, PDA, car infotainment, etc., generally will have slower processors, less permanent storage (flash memory or hard disk), less memory, and smaller displays than desktop computers. In such case QT can come into rescue.
Unlike Qt/X11, it does not need the X Window System; instead, it implements its own window system QWS (Qt Window System), enabling significant storage and memory savings. To reduce its memory footprint even more, Qt/Embedded Linux can be recompiled to exclude unused features. If the applications and components used on a device are known in advance, they can be compiled together into a single executable that links statically against the Qt/Embedded Linux libraries.
Qt draws directly to the Linux framebuffer Make sure the /dev/fb0 device have write permissions to access the framebuffer, otherwise it may though permission denied errors.
$ ./qt_app –qws
QApplication app(argc, &argv0, QApplication::GuiServer);
If you are running only one application then simply passing -qws or else if you are planning to run multiple GUI application then passing QApplication::GuiServer to QApplication constructor is good option.
Else if there are more than one QT application to be executed at a time, then having a QT GUI server running in the background and multiple clients connecting to that server and using the framebuffer is better choice. where the server will take care of sharing the desktop between devices.
Here is a simple QT GUI server code.
int main(int argc, char *argv)
// Start the qtapp thread in server mode
QApplication app(argc, argv, QApplication::GuiServer);
Compile this application and execute it in background in the target board
$ ./qt_server &
Our QT GUI server is running in the background and ready to service the QT clients, So now start you QT app, may be a simple hello app to test.
All the best.