Hi, I need to implement a simple custom desktop environment for a mobile device (it's a learning exercise). I'm using Qt Embedded for Linux. I want to realize the classic structure of a mobile desktop:

- A top-level status bar.
- An active area where windows are painted.

The status bar and active area management are implemented in a server application, other windows are part of separated applications. I want that each window is painted maximized (only one window per time) only in the active area.

Currently I've written this code snippet:

Server
Qt Code:
  1. #include "server.h"
  2. #include <QtGui/QDesktopWidget>
  3. #include <QtGui/QWSServer>
  4.  
  5. Server::Server(int argc, char **argv)
  6. : QApplication(argc, argv, QApplication::GuiServer)
  7. {
  8. QRect screen_rect = this->desktop()->screenGeometry();
  9. QRect active_rect = screen_rect.adjusted(0, m_statusBar.height(), 0, 0);
  10.  
  11. m_statusBar.show();
  12.  
  13. qwsServer->setMaxWindowRect(active_rect);
  14. }
To copy to clipboard, switch view to plain text mode 

Client1
Qt Code:
  1. #include "client1.h"
  2.  
  3. Client1::Client1(int argc, char **argv)
  4. : QApplication(argc, argv, QApplication::GuiClient)
  5. {
  6. m_mainWindow.showMaximized();
  7. }
To copy to clipboard, switch view to plain text mode 

It works but if a client application shows a window not maximized, the window overlaps the status bar and I don't want this.

Another question: how can I do this with QGraphicsView instead?