Delete QComboBox listView shadow effect

By default, the list QComboBoxhas a shadow effect. Is there any way to remove it? Is the shadow controlled from QStyleor in any other way?

qcombobox shadow

+4
source share
1 answer

The shadow effect is not a specific feature of Qt, its specifics for the desktop. The shadow depends on the style / theme used by your work environment. If your style / theme defines the shadows for the QComboBox, then Qt draws it very quickly. However, you can look for a style that does not paint a shadow. I got the effect by doing this:

cb = QComboBox()
cb.addItems( [ '1', '2', '3', '4', '5', '6' ] )
cb.setStyle( QStyleFactory.create( "Polyester" ) )
cb.setStyleSheet( "QComboBox QAbstractItemView { border: 1 px solid gray; }" )
cb.show()

, , , QStyleFactory.keys(). QtCurve, . , GTK+ Cleanlooks.

FYI: - , KDE.

:

enter image description here

+4

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


All Articles