The QT embeded application does not strictly distinguish the server and client processes. If the startup parameters of a QT Process contain-qws, the process has the server Hu management function, known as qws server, of course, this process can also be used to create and display widgets like other QT processes. Only the server function can be used simultaneously.
This so-called server function is mainly implemented by the qwsserver object.
1. Management object of qwsserver
(1) keyboard and mouse Devices
Keyboard and mouse are input devices of the display system. In QT embedded, qwsserver initializes and manages the keyboard and mouse devices. Read key events and mouse events and send them to corresponding applications.
As for the display device screen in the diplay system, This is not managed by the qwsserver in a unified manner. To improve efficiency, each QT client can open this device and read and write it to the screen for display. But every QT client reads and writes to screen. Will the screen be messy? In QT, this part of work is managed by a diagonal corner of qwsregionmanager, which will be detailed later.
(2) qwsclient
It seems that the qwsserver and qwsclient classes should form a C/S structure. In fact, qwsserver represents a server socket. when QT client connects to the server socket of qwsserver, qwsserver generates a client socket to communicate with the socket of QT client. Qwsclient looks like a stub object, representing a QT client process. Each QT client process has a qwsclient in the qws server process.
(3) qwswindow
Qwswindow corresponds to the toplevel widget of QT client. Nontoplevel widgets are managed by each QT client. All toplevel widgets must be managed by the qws server, including the focus, altitude, and region of widgets.
(4) Others
Other global objects managed by qwsserver include qwsscreensaver and qwssoundserver.
2. qwsserver Initialization
Qwsserver Initialization is completed during the qapplication initialization process. The specific process is as follows:
Qapplication: Construct --> qt_init --> qwsserver: startup
Qwsserver: startup is a static function. The constructor that creates the Global Object qwsserver. qwsserver will initialize the Managed Objects in sequence.