Results 1 to 2 of 2

Thread: Which widget within the workspace window has "focus"?

  1. #1
    Join Date
    Jan 2009
    Posts
    34
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Which widget within the workspace window has "focus"?

    Hi.

    I have a menu that builds up a list of visible dialogs (like some browsers do) and I want to sens which dialog is in front/has focus, i.e. I want to know which dialog that has the blue titlebar.

    I tried hasFocus(), but none has. This seems logical as I at the moment is opening the menu.

    I also tried isActiveWindow(), but this was true for all my dialogs inside the workspace.

    Any suggestions?
    Last edited by zarkzervo; 15th September 2009 at 08:34. Reason: Title was somewhat misleading

  2. #2
    Join Date
    Jan 2009
    Posts
    34
    Thanks
    2
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Which widget within the workspace window has "focus"?

    Solved!

    The solution was not in the widget itself, but in the QWorkspace that owned the widget.

    I used workspace->activeWindow() and compared it with each of the widgets in the workspace->windowList() and found out which had "focus".

Similar Threads

  1. How to set Qt window transparent?
    By montylee in forum Qt Programming
    Replies: 17
    Last Post: 24th December 2013, 20:11
  2. Replies: 2
    Last Post: 9th August 2009, 22:08
  3. QMain Window Problem
    By maveric in forum Qt Programming
    Replies: 1
    Last Post: 24th May 2008, 15:51
  4. Set a window as child at runtime
    By sabeesh in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2007, 09:30
  5. Change shape of window / animate window
    By sabeesh in forum Qt Programming
    Replies: 3
    Last Post: 31st October 2007, 08:16

Tags for this Thread

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.