Results 1 to 6 of 6

Thread: Available Screen Problem

  1. #1
    Join Date
    Sep 2006
    Posts
    68
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Unhappy Available Screen Problem

    Hi All,

    I am having a problem placing a window just above the taskbar, and detecting if there is a taskbar at the top (normal for Gnome and OSX, not usually on KDE and Windows).

    For some reason both..

    QApplication::desktop()->screenGeometry() and
    QApplication::desktop()->availableGeometry()

    ..are returning exactly the same, the full size of the screen.

    Any ideas what I might be doing wrong?

    Thanks

  2. #2
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Available Screen Problem

    There was a similar thread a while ago :

    Don't know if it helps.

    http://www.qtcentre.org/forum/f-qt-p...hlight=systray

  3. #3
    Join Date
    Sep 2006
    Posts
    68
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Available Screen Problem

    Thanks for the post, but what is being suggested in the thread is what I am already doing.

    The problem is that availableGeometry is returning exatly the same as screenGeometry.

  4. #4
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Available Screen Problem

    Well, maybe I'm silly on this one, but does QDesktopWidget::availableGeometry() is exactly the same as QApplication::desktop()->availableGeometry() ?

    Another (ugly) hint, would be to deduce the systray height from the QSystemTrayIcon geometry (which is available)

    My 2 cents..

  5. #5
    Join Date
    Sep 2006
    Posts
    68
    Thanks
    15
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Available Screen Problem

    From the documentation:
    QDesktopWidget::QDesktopWidget ()

    Creates the desktop widget.

    If the system supports a virtual desktop, this widget will have the size of the virtual desktop; otherwise this widget will have the size of the primary screen.

    Instead of using QDesktopWidget directly, use QApplication::desktop().
    This seems to imply the way to use QDesktopWidget is to get it return from QApplication.

    A quick test creating a new Desktop widget also had the same result. For some reason it availableGeometry is ignoring any taskbars on the screen totally.

  6. #6
    Join Date
    Jan 2006
    Location
    Paris, France
    Posts
    227
    Thanks
    3
    Thanked 21 Times in 21 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Available Screen Problem

    Maybe you should suggest something about this feature to Trolls, then ;-)

Similar Threads

  1. multi screen
    By Thomas Feldman in forum Qt Programming
    Replies: 5
    Last Post: 9th May 2007, 16:41
  2. QMainWindow resize problem
    By edb in forum Qt Programming
    Replies: 5
    Last Post: 12th January 2007, 10:31
  3. Replies: 16
    Last Post: 7th March 2006, 15:57
  4. hide/show screen update problem
    By SkripT in forum Qt Programming
    Replies: 2
    Last Post: 6th February 2006, 17:49
  5. Problem with screen update...
    By mysearch05 in forum Qt Programming
    Replies: 2
    Last Post: 27th January 2006, 18:24

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.