Results 1 to 6 of 6

Thread: QWidget help please

  1. #1
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default QWidget help please

    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.

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidget help please

    How about using QSplashScreen ?? it inherits QWidget and might serve your purpose ..
    may be I am wrong, but its just a idea...

  3. #3
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidget help please

    Thanks for your reply.

    QSplashScreen also draws the background which hides the desktop.

    Any more ideas ?

    Thanks a lot

  4. #4
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QWidget help please

    How about masking, QWidget::setMask()?
    J-P Nurmi

  5. #5
    Join Date
    Jan 2006
    Posts
    667
    Thanks
    10
    Thanked 80 Times in 74 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QWidget help please

    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.

  6. #6
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QWidget help please

    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
    J-P Nurmi

Similar Threads

  1. QWidget -> updateGeometry dont work.
    By patrik08 in forum Qt Programming
    Replies: 7
    Last Post: 22nd May 2013, 15:55
  2. Transparent QWidget on QGLWidget
    By showhand in forum Qt Programming
    Replies: 2
    Last Post: 27th November 2006, 01:00
  3. Replies: 1
    Last Post: 2nd May 2006, 21:11
  4. moving QWidget and Mainform
    By mickey in forum Newbie
    Replies: 9
    Last Post: 6th April 2006, 17:54
  5. QScrollArea problem positioning a QWidget inside
    By Spectator in forum Qt Programming
    Replies: 4
    Last Post: 20th February 2006, 22:59

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.