Search code examples
qttransparencyqt5qcomboboxqtstylesheets

QCombobox transparent item list stylesheet


I try to do list from QComboBox I believe it is QListView/QAbstractItemView to become transparent. Like in this example I would like to see Pushbutton under the list.

enter image description here

I tried to put:

background: transparent background-color: transparent border-style: transparent border-color: transparent

like everywhere.


Solution

  • So, I asked qt support and and answer was that is not easy to do this in stylesheet and suggested approach was to change opacity property of the pop-up window where the combobox list is drawn:

    if (combo->view()->parentWidget())
        combo->view()->parentWidget()->setWindowOpacity(0.5);
    

    Hope this will be helpful.