Results 1 to 2 of 2

Thread: background color for QGraphicsWidget

  1. #1
    Join Date
    Jul 2009
    Posts
    5

    Default background color for QGraphicsWidget

    Hello all,
    I'm trying the following to set background color for a QGrahpicsWidget object

    Qt Code:
    1. QGrahpicsWidget* w = new QGrahpicsWidget();
    2. QBrush brush;
    3. QPalette palette;
    4. palette = w->palette();
    5. brush.setColor(Qt::blue);
    6. palette.setBrush(QPalette::Active, QPalette::Background, brush);
    7. w->setPalette(palette);
    To copy to clipboard, switch view to plain text mode 

    but it doesn't work
    any one has an idea???
    thx to much

  2. #2
    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: background color for QGraphicsWidget

    I'm afraid this functionality is not supported by QGraphicsWidget. You could file a suggestion to add "autoFillBackground" property like QWidget has.
    J-P Nurmi

Similar Threads

  1. Replies: 2
    Last Post: 10th February 2009, 13:12
  2. QLCDNumber with transparent background?
    By PolyVox in forum Qt Programming
    Replies: 2
    Last Post: 20th October 2008, 05:34
  3. Replies: 5
    Last Post: 30th March 2008, 16:53
  4. background colour
    By kw in forum Qt Programming
    Replies: 6
    Last Post: 11th April 2006, 00:44
  5. Replies: 1
    Last Post: 5th April 2006, 16:44

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.