Rounded QComboBox without a square box behind

I am developing a QComboBox in Qt. It is rounded, as the figure shows. The problem is that it shows a weird square box beyond a rounded border.

Can someone tell me what the window is and how to make it invisible?

By the way, I would also like to cast a shadow.

enter image description here

Here is my current code:

QComboBox { border: 1px solid gray; border-radius: 10px; min-width: 6em; } QComboBox:on { border-bottom-left-radius: 0px; border-bottom-right-radius: 0px; } QComboBox QAbstractItemView { border-bottom-right-radius: 10px; border-bottom-left-radius: 10px; background: white; border: 1px solid gray; box-shadow: transparent; } QComboBox::drop-down { border-color: transparent; } 

Can anyone help here? Thanks!

+5
source share
2 answers

you can add code like this

 (your qcombobox)->view()->window()->setWindowFlags(Qt::Popup | Qt::FramelessWindowHint | Qt::NoDropShadowWindowHint); 

I tried, it works

0
source

Maybe you can provide some html that makes it easier.

Try:

 QComboBox{overflow:hidden} 
-2
source

Source: https://habr.com/ru/post/1211152/


All Articles