Results 1 to 6 of 6

Thread: how to make transparent qgraphicsproxywidget

  1. #1
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default how to make transparent qgraphicsproxywidget

    hi friends,
    how can i add a QSlider with groove as transparent but not the handle and add the widget as a QGraphicsProxyWidget i tried like this ..
    Qt Code:
    1. theSlider->setStyleSheet("QSlider::groove:horizontal {background-color: rgba(255, 255, 255, 50);} QSlider::handle:horizontal {background: black;};");
    2.  
    3. QGraphicsProxyWidget *sliderItem = new QGraphicsProxyWidget(this);
    4. // sliderItem->setOpacity(0.3);
    5. sliderItem->setWidget(theSlider);
    To copy to clipboard, switch view to plain text mode 

    if i enable opacity its showing transparent slider but handle also looks transparent .
    if i make background-color : transparent .. it is looking like a white box ...
    how to make the widget transparent in qgraphicsproxywidget ..

    please help me ..
    "Behind every great fortune lies a crime" - Balzac

  2. #2
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to make transparent qgraphicsproxywidget

    can anyone please
    help me how i can add a semi transparent QGraphicsProxy widget to scene
    "Behind every great fortune lies a crime" - Balzac

  3. #3
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to make transparent qgraphicsproxywidget

    Did you try to use QSS's opacity property?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  4. The following user says thank you to spirit for this useful post:

    wagmare (29th October 2013)

  5. #4
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to make transparent qgraphicsproxywidget

    u mean setWindowOpacity() ..?
    yes i did that .. its making the whole slider transparent ..
    "Behind every great fortune lies a crime" - Balzac

  6. #5
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: how to make transparent qgraphicsproxywidget

    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  7. #6
    Join Date
    Sep 2008
    Location
    Bangalore
    Posts
    659
    Thanks
    116
    Thanked 42 Times in 41 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to make transparent qgraphicsproxywidget

    thx spirit ...

    Qt Code:
    1. QWidget *wid = new QWidget;
    2.  
    3.  
    4. QPalette palette ;
    5. palette.setBrush(QPalette::Background, Qt::transparent);
    6. wid->setPalette(palette);
    7.  
    8. wid->setAutoFillBackground(false);
    9.  
    10. theSlider = new QSlider(wid);
    11.  
    12. theSlider->setStyleSheet("background-color:transparent");
    13.  
    14. graphicsProxyItem->setWidget(wid);
    To copy to clipboard, switch view to plain text mode 
    "Behind every great fortune lies a crime" - Balzac

Similar Threads

  1. how to make lineedit transparent
    By RENOLD in forum Qt Programming
    Replies: 3
    Last Post: 20th February 2012, 16:24
  2. make transparent a QTextEdit
    By qlands in forum Newbie
    Replies: 3
    Last Post: 6th October 2011, 16:40
  3. How to make certain areas transparent with the desktop?
    By Sir Rogers in forum Qt Programming
    Replies: 5
    Last Post: 11th May 2010, 23:08
  4. Replies: 2
    Last Post: 14th February 2010, 17:02
  5. how can make the widget transparent
    By duduqq in forum Qt Programming
    Replies: 2
    Last Post: 24th June 2008, 13:24

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.