Results 1 to 3 of 3

Thread: How to prevent a popup dialog gaining focus

  1. #1
    Join Date
    Feb 2010
    Posts
    52
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default How to prevent a popup dialog gaining focus

    Hi all,
    Is there a way to prevent a non-modal dialog gaining focus / becoming active when it is shown ?

    Cheers,
    Chris.

  2. #2
    Join Date
    Jan 2008
    Location
    Bengaluru
    Posts
    144
    Thanks
    8
    Thanked 7 Times in 7 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: How to prevent a popup dialog gaining focus


  3. #3
    Join Date
    Feb 2010
    Posts
    52
    Thanks
    6
    Thanked 2 Times in 2 Posts

    Default Re: How to prevent a popup dialog gaining focus

    Hi,
    Thanks for your suggestion. I have tried calling setFocus after showing my dialog on the widget that originally had focus, however it does not regain the focus.

    Having said that, ideally, I really dont want the widget to loose focus at all - I simply want the dialog to be displayed but not gain focus or become active.


    Added after 9 minutes:


    I seem to get the desired effect by calling activateWindow on the original widget after showing my dialog
    Last edited by chris_helloworld; 14th December 2010 at 13:47.

Similar Threads

  1. Prevent QStyledItemDelegate from drawing focus rectangle
    By stefanadelbert in forum Qt Programming
    Replies: 4
    Last Post: 15th July 2010, 10:43
  2. QWidget (Qt::Popup), Signal when close or lost focus
    By Tondog in forum Qt Programming
    Replies: 1
    Last Post: 23rd April 2010, 09:17
  3. Popup dialog from task bar?
    By probine in forum Qt Programming
    Replies: 1
    Last Post: 4th April 2010, 09:24
  4. Replies: 1
    Last Post: 5th August 2008, 21:44
  5. how to create a popup dialog
    By Morea in forum Qt Programming
    Replies: 1
    Last Post: 19th November 2006, 17:40

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.