Results 1 to 3 of 3

Thread: QT4 version for QT3 setBackgroundMode( NoBackground )

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Aug 2007
    Posts
    244
    Thanks
    42
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default QT4 version for QT3 setBackgroundMode( NoBackground )

    Hi,
    I'm trying to add an "on screen display" object to my application like amarok's osd. So reading Amarok 1.4.9 source code I have found the code in the object in the class OSDWidget of the files osd.h/osd.cpp. Here a sample:

    Qt Code:
    1. class OSDWidget : public QWidget
    2. {
    3. Q_OBJECT
    4.  
    5. OSDWidget( QWidget *parent, const char *name = "osd" );
    6. ...
    7. };
    8.  
    9. OSDWidget::OSDWidget( QWidget *parent, const char *name )
    10. : QWidget( parent, name)
    11. {
    12. ...
    13. setBackgroundMode( NoBackground );
    14. ...
    15. }
    To copy to clipboard, switch view to plain text mode 

    How port that line in qt4? Perhaps the solution is QWidget::setBackgroundRole but there isn't a Qt::NoBackground.

    Or anybody knows a simple code?

    Thanks
    Giuseppe CalÃ

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QT4 version for QT3 setBackgroundMode( NoBackground )

    NoBackground != transparency. It just means that Qt doesn't draw the default background before calling paintEvent(). In Qt 4 you can achieve the same by setting WA_OpaquePaintEvent attribute.

  3. #3
    Join Date
    Aug 2007
    Posts
    244
    Thanks
    42
    Thanked 8 Times in 8 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: QT4 version for QT3 setBackgroundMode( NoBackground )

    Very thanks, jacek.
    Giuseppe CalÃ

Similar Threads

  1. Qt designer plugin errors on OSX Leopard
    By mpotocnik in forum Qt Tools
    Replies: 10
    Last Post: 21st January 2008, 09:45
  2. Replies: 2
    Last Post: 5th November 2007, 21:47
  3. Distributing QT application for Mac OS
    By mb0 in forum Qt Programming
    Replies: 1
    Last Post: 31st May 2007, 18:59
  4. Replies: 15
    Last Post: 21st April 2007, 17:46

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.