Skip to content

Instantly share code, notes, and snippets.

@frueter
Created September 15, 2022 21:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save frueter/c36916f8e0901b332a88cbd71ff91c5d to your computer and use it in GitHub Desktop.
Save frueter/c36916f8e0901b332a88cbd71ff91c5d to your computer and use it in GitHub Desktop.
import sys
from PySide2 import QtWidgets
args = sys.argv
app = QtWidgets.QApplication(args)
w = QtWidgets.QComboBox()
for i in range(10):
w.addItem(str(i))
style_content = "QWidget:item:selected{background-color: red;}"
w.setStyleSheet(style_content)
w.show()
sys.exit(app.exec_())
@frueter
Copy link
Author

frueter commented Sep 15, 2022

why does the stytlesheet entry create an indented combobox item with tick mark on hover?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment