Results 1 to 5 of 5

Thread: Desktop environment for mobile devices

  1. #1
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Desktop environment for mobile devices

    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?

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Desktop environment for mobile devices

    It works but if a client application shows a window not maximized, the window overlaps the status bar and I don't want this.
    you can use the Qt::WindowStaysOnTopHint flag for the status bar
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  3. #3
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Desktop environment for mobile devices

    Thanks, it works. But how can I force the window's region to the active area?

  4. #4
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Desktop environment for mobile devices

    you can set a widget to be a desktop widget also with a window flag.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

  5. #5
    Join Date
    Mar 2009
    Posts
    72
    Thanks
    7
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: Desktop environment for mobile devices

    And after that?

    I've tried to create a custom widget with Qt::Desktop flag set, but windows seem to ignore it.

Similar Threads

  1. QNOME - Another Desktop Environment
    By MIH1406 in forum Qt Programming
    Replies: 3
    Last Post: 22nd September 2009, 17:23
  2. Replies: 2
    Last Post: 19th November 2008, 09:01
  3. Eclipse question
    By MarkoSan in forum General Discussion
    Replies: 5
    Last Post: 18th November 2008, 08:38
  4. Detect Desktop Environment
    By phannent in forum Qt Programming
    Replies: 2
    Last Post: 19th August 2008, 14:31
  5. problem with indexes
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 10th December 2007, 14:55

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.