Results 1 to 4 of 4

Thread: show new dialog with keeping focus.

  1. #1
    Join Date
    Sep 2011
    Posts
    5
    Thanked 3 Times in 3 Posts

    Unhappy show new dialog with keeping focus.

    Hello.

    I wanna make an alarm dialog which doesn't have a focus.

    These days, I'm making the alarm dialog however when the dialog appears, window focus is switched to the dialog.

    I want to keep window focus even though the dialog appears.

    How can I make?

    Thank you

  2. #2
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: show new dialog with keeping focus.

    The first that comes to me mind is calling showMinimized(), but it affects only windows.
    I'm a rebel in the S.D.G.

  3. #3
    Join Date
    Sep 2011
    Posts
    5
    Thanked 3 Times in 3 Posts

    Default Re: show new dialog with keeping focus.

    I found good solution!

    setAttribute(Qt::WA_ShowWithoutActivating);

  4. #4
    Join Date
    May 2008
    Location
    Kyiv, Ukraine
    Posts
    418
    Thanks
    1
    Thanked 29 Times in 27 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: show new dialog with keeping focus.

    Great. Honestly, I didn't know this option exists. I will know now.
    I'm a rebel in the S.D.G.

Similar Threads

  1. How to prevent a popup dialog gaining focus
    By chris_helloworld in forum Qt Programming
    Replies: 2
    Last Post: 14th December 2010, 13:47
  2. forcing dialog focus?
    By jajdoo in forum Newbie
    Replies: 1
    Last Post: 3rd September 2010, 21:17
  3. How to show window without stealing focus?
    By piotr.dobrogost in forum Qt Programming
    Replies: 2
    Last Post: 9th June 2009, 07:26
  4. How to show/draw focus & select at the same time
    By tanminh in forum Qt Programming
    Replies: 2
    Last Post: 6th November 2006, 22:06
  5. Keeping focus at bottom of QListView
    By jakamph in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2006, 15:45

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.