PDA

View Full Version : QWidget help please



munna
20th December 2006, 06:18
Hi,

Is there a way by which a widget without a parent can be made to behave like a widget with a parent. For example no autoFillBackground, no frame.

Basically, it should be a widget as big as the desktop itself, on which some text can be drawn. It will appear as if the text is drawn on the desktop itself but in reality there will be a transparent widget on which the text will be drawn.

Any ideas on how this can be done?

Thanks a lot.

aamer4yu
20th December 2006, 06:38
How about using QSplashScreen ?? it inherits QWidget and might serve your purpose ..
may be I am wrong, but its just a idea...:)

munna
20th December 2006, 07:36
Thanks for your reply.

QSplashScreen also draws the background which hides the desktop.

Any more ideas ?

Thanks a lot

jpn
20th December 2006, 07:37
How about masking, QWidget::setMask()?

munna
20th December 2006, 07:47
setMask will not help because i need to catch the mousePressEvent and mouseReleaseEvent even on the transparent part.

Here is the basic idea :

1. The application has some text that can be seen big (huge) if user wants to.
2. The the text appears as if it is drawn on the desktop itself.
3. When user is done with the viewing, he/she can preform any keyboard or mouse event (not mouse move) anywhere on the desktop (since the text appears to be drawn on the desktop) and the huge text will disappear.

Is there a simple and platform independent way of implementing this ?

Thanks a lot.

jpn
20th December 2006, 11:08
Just an idea:
1) use masking as proposed
2) additionally use window flags to hide the taskbar entry
3) QWidget::lower() the window so it becomes the bottom most window
4) instead of trying to catch input events for the whole screen, try detecting situations like when the window is deactivated and so on