PDA

View Full Version : Display QDialog on Top of all.



sudhansu
14th April 2010, 10:52
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.

wysota
14th April 2010, 11:15
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.

sudhansu
14th April 2010, 12:08
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.

wysota
14th April 2010, 12:24
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.

sudhansu
21st April 2010, 16:32
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.

wysota
21st April 2010, 17:14
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.

sudhansu
22nd April 2010, 08:42
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