Results 1 to 6 of 6

Thread: transparent qcombobox?

  1. #1
    Join Date
    Aug 2009
    Posts
    81
    Platforms
    MacOS X Windows

    Default transparent qcombobox?

    how is it possible to make the background of the dropdown list of a QComboBox semi transparent?

    thank you in advance for your help

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: transparent qcombobox?

    What did you already try?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  3. #3
    Join Date
    Aug 2009
    Posts
    81
    Platforms
    MacOS X Windows

    Default Re: transparent qcombobox?

    i tried

    Qt Code:
    1. cbox->view()->setWindowOpacity(.5);
    To copy to clipboard, switch view to plain text mode 

    and also

    Qt Code:
    1. QPalette pal = cbox->view()->palette();
    2. pal.setBrush(QPalette::Base, Qt::transparent);
    3. cbox->view()->setPalette(pal);
    To copy to clipboard, switch view to plain text mode 


    both does not work

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: transparent qcombobox?

    Try using Qt::WA_TranslucentBackground.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    Aug 2009
    Posts
    81
    Platforms
    MacOS X Windows

    Default Re: transparent qcombobox?

    it does not make any difference...

    i am in style plastique, i got the feeling a background color is written first then the 50% opacity is added on top.. how to make sure there is no background paint on this wiget

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: transparent qcombobox?

    You may have to provide a custom delegate to the view. One that does not paint the background or does it with translucency.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


Similar Threads

  1. How to set Qt window transparent?
    By montylee in forum Qt Programming
    Replies: 17
    Last Post: 24th December 2013, 20:11
  2. Make the QComboBox popup translucent or transparent ?
    By charlse in forum Qt Programming
    Replies: 5
    Last Post: 18th August 2008, 16:18
  3. leaveEvent on transparent area issue
    By nooky59 in forum Qt Programming
    Replies: 10
    Last Post: 8th January 2008, 13:22
  4. QComboBox drop list button events
    By maird in forum Qt Programming
    Replies: 5
    Last Post: 20th October 2007, 19:25
  5. using QComboBox as an ItemView
    By EricTheFruitbat in forum Qt Programming
    Replies: 3
    Last Post: 24th January 2007, 16:14

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.