Results 1 to 7 of 7

Thread: Display QDialog on Top of all.

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Posts
    105
    Thanked 4 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Display QDialog on Top of all.

    Hi All
    I'm doing a two way communication kind of application. here more than 50 computers are connected through LAN (One will be acting as master , others are slave), and the can send message to each other. Once a computer gets the message it'll be displayed in a QDialog. My problem is that if maste gets reply he need to display it on top of all shell and even if internet exploreer. i down want to use Qt::WindowStaysOnTopHint, as it is not suitable for my application. I used raise() and activatewidow() call aslo. But If i've opened a terminal or firfox and getting any message then message is displaying behind it. How to solve, Plz help.

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

    Default Re: Display QDialog on Top of all.

    Why can't you use WindowStaysOnTopHint? As far as I understand it does exactly what you want - brings a specified window on top of every other window on the desktop.

  3. #3
    Join Date
    Oct 2009
    Posts
    105
    Thanked 4 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Display QDialog on Top of all.

    Quote Originally Posted by wysota View Post
    Why can't you use WindowStaysOnTopHint? As far as I understand it does exactly what you want - brings a specified window on top of every other window on the desktop.
    Thank you wysota, for replying to this message. Actually If i use WindowStaysOnTopHint flag then i'm facing some probem like. I've opened a firefox and client send a message to me, its coming on top of the firefox, but acting as a modal box. Till i cannot give response to this dialog i cannot intract with other application.

    NB: this dialog taking Mainwinodw as an argument.

    Thank you.

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

    Default Re: Display QDialog on Top of all.

    Quote Originally Posted by sudhansu View Post
    Thank you wysota, for replying to this message. Actually If i use WindowStaysOnTopHint flag then i'm facing some probem like. I've opened a firefox and client send a message to me, its coming on top of the firefox, but acting as a modal box.
    I don't think the flag has anything to do with modality. Modality of a dialog is controlled by how you make it visible - via show() or exec(). Either way it shouldn't influence other applications in any way other than staying on top of their windows. If what you observe is different then it might be caused by your window manager as the hint is only a hint to the window manager that may respect it or not and may implement it the way it wants and neither Qt nor your application can do anything about it.

  5. #5
    Join Date
    Oct 2009
    Posts
    105
    Thanked 4 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Display QDialog on Top of all.

    Quote Originally Posted by wysota View Post
    I don't think the flag has anything to do with modality. Modality of a dialog is controlled by how you make it visible - via show() or exec(). Either way it shouldn't influence other applications in any way other than staying on top of their windows. If what you observe is different then it might be caused by your window manager as the hint is only a hint to the window manager that may respect it or not and may implement it the way it wants and neither Qt nor your application can do anything about it.

    If I'm opening my dialog using this Flag, then whatever firefox i'm opening it is opening behind this dialog. I need the following.
    If any bash or firefox is opened and i get any message from my server I've to open a diloag, which should come on top of this firefox.

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

    Default Re: Display QDialog on Top of all.

    You can't display a dialog this way. You can probably do it with a regular top-level window, but not with a modal dialog. At least I don't see that happening.

  7. #7
    Join Date
    Oct 2009
    Posts
    105
    Thanked 4 Times in 2 Posts
    Qt products
    Qt/Embedded
    Platforms
    Unix/X11

    Default Re: Display QDialog on Top of all.

    Quote Originally Posted by wysota View Post
    You can't display a dialog this way. You can probably do it with a regular top-level window, but not with a modal dialog. At least I don't see that happening.
    Hi Wysota
    herewith i've attached a sample application. Plz chk it. run the application and then open firefox.

    Thank you.
    Regards
    Sudhansu
    Attached Files Attached Files

Similar Threads

  1. closing a Qdialog called from a Qdialog
    By OverTheOCean in forum Qt Programming
    Replies: 3
    Last Post: 28th September 2009, 08:02
  2. How to "lock" a new qdialog in another qdialog
    By donglebob in forum Qt Programming
    Replies: 7
    Last Post: 4th February 2009, 08:37
  3. display informations of QDirModel on QDialog
    By hbill in forum Qt Programming
    Replies: 1
    Last Post: 10th April 2008, 21:36
  4. QDialog
    By seldeepchan in forum Qt Programming
    Replies: 1
    Last Post: 6th March 2008, 12:21
  5. QDialog
    By vijay anandh in forum Qt Programming
    Replies: 4
    Last Post: 8th April 2006, 07:56

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.