PDA

View Full Version : Top widget



jay
28th March 2009, 04:40
I need to do a sample Qt application in which the widget should always stay on top (that is always visible to user) and also this widget's space shouldn't occupied by any other application.

say if Qt widget position stats from top left of the screen (0,0) and occupies 1/4 th of the screen, and other applications should be placed in 3/4 th of the screen. can this be achieved in Qt?.

I have tried with Qt::WindowStaysOnTopHint, in this case all other widgets goes below this top widget.

if any one tried like this before help me.

I am using Qt4.4.0 in windows.

aamer4yu
28th March 2009, 10:20
I need to do a sample Qt application in which the widget should always stay on top (that is always visible to user) and also this widget's space shouldn't occupied by any other application.

I dont think that will be possible in Qt. You are not windows manager, and you cant restrict other windows from occupying desktop space

Lykurg
28th March 2009, 10:24
Well you can generate a stand alone QWidget with Qt::WindowStaysOnTopHint and sync it with your app geometry.

wysota
28th March 2009, 10:34
Well you can generate a stand alone QWidget with Qt::WindowStaysOnTopHint and sync it with your app geometry.

But this won't prevent the desktop manager from placing a window underneath the top-level window.

Lykurg
28th March 2009, 10:38
But this won't prevent the desktop manager from placing a window underneath the top-level window.
Ah, right. Misread the question...

jay
30th March 2009, 05:53
Thank you very much for all your answers.

QDesktopWidget helps in any way for doing this?

talk2amulya
30th March 2009, 07:41
QDesktopWidget again can only provide you with the screen geometry. You can use it to place your widget on the desried location on the screen. BUT It cant help you to acquire the screen area for good. other windows will be able to use that area and they should be. I dont understand your fascination with that area though :) i mean u can always keep it on top, that should be enough. Why do you need to not allow other windows to acquire that area?

jay
30th March 2009, 07:56
The GUI having many control buttons. It is flexible for us if we have this as a separate one instead of showing on top of other windows.

talk2amulya
30th March 2009, 08:02
even if it has many buttons, if it stays on top always, i believe your issue must be resolved. Also i think you'd be wasting a lot of your time trying to find a solution to this and if it exists, implementing it(i dont think there is any "Qt way" to do it). Providing Qt::WindowStaysOnTopHint works for you on every operating system, you shouldnt be bothered about other applications/widgets taking your area.