Results 1 to 4 of 4

Thread: How to ensure widget is visible

  1. #1
    Join Date
    Mar 2009
    Location
    Belchatow, Poland
    Posts
    38
    Thanks
    11
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default How to ensure widget is visible

    Hello, I want to achieve something like this: I have a tray icon and when I click it I want it to toggle the visibility of my main window. That sounds easy to achieve, but there's one problem, when my window is behind another application's window it is still considered visible so clicking tray icon hides it and i have to double click to make it visible. This isn't a big deal but can be annoying, is there a function in Qt to know is a window covered by another window? Using QWidget::activeWindow() always returns false because when I click the tray icon the window looses focus and is not active.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to ensure widget is visible

    There is no Qt way to do that.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. The following user says thank you to wysota for this useful post:

    arturo182 (1st September 2009)

  4. #3
    Join Date
    Mar 2009
    Location
    Belchatow, Poland
    Posts
    38
    Thanks
    11
    Thanked 4 Times in 4 Posts
    Qt products
    Qt4
    Platforms
    Windows Symbian S60

    Default Re: How to ensure widget is visible

    But I saw an application that could do this so maybe it can be achieved using WinAPI, I can use WinAPI in Qt, right? Of course it will only work on Windows.

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to ensure widget is visible

    Sure you can. I'm also sure there is an X11 equivalent.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. QDockWidget inside another widget in the center?
    By Antebios in forum Qt Programming
    Replies: 1
    Last Post: 16th February 2010, 08:06
  2. Replies: 2
    Last Post: 19th August 2008, 10:46
  3. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 11:35
  4. Replies: 1
    Last Post: 22nd October 2007, 03:04
  5. Replies: 4
    Last Post: 24th March 2006, 23:50

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.