Results 1 to 2 of 2

Thread: Close child dialog when click outside of it

  1. #1
    Join Date
    Feb 2013
    Posts
    4
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Windows

    Default Close child dialog when click outside of it

    I have 2 dialogs: a parent dialog and child dialog (see image).
    ask.JPG
    When user open the child dialog, parent dialog will be blurred. I want to close the child dialog when user clicks inside parent dialog (but outside of the child dialog). I tried to reimplement mousePressEvent of child dialog but nothing happens!

    Can anyone guide me how to do this?

    Thank you very much.

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

    Default Re: Close child dialog when click outside of it

    The easiest way to do it is to make your child window a Qt::ToolTip, if I remember correctly. In doubt see in Qt source code how to use this flag.
    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:

    warcraff123456 (7th April 2013)

Similar Threads

  1. midi child does not close when I call close()
    By qlands in forum Qt Programming
    Replies: 7
    Last Post: 29th July 2011, 22:25
  2. Replies: 2
    Last Post: 6th May 2011, 08:02
  3. How to access objects of parent Dialog from Child Dialog .
    By ranjit.kadam in forum Qt Programming
    Replies: 4
    Last Post: 18th April 2011, 06:39
  4. closing child dialog closes parent dialog
    By sparticus_37 in forum Newbie
    Replies: 2
    Last Post: 28th May 2010, 19:46
  5. How to blur parent dialog when child dialog is displayed
    By abhilashajha in forum Qt Programming
    Replies: 4
    Last Post: 10th June 2009, 13:01

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
  •  
Qt is a trademark of The Qt Company.