Reputation: 91
I have a PyQt window with a custom stylesheet. On MacOS the QLineEdit is highlighted in blue when it is active, which ruins the stylesheet I am using. Is there any way to either stop this from happening or change the highlight colour that is used?
Upvotes: 1
Views: 696
Reputation: 243897
You can change it using the QPalette:
le = QtWidgets.QLineEdit()
pal = le.palette()
pal.setColor(
QtGui.QPalette.Active, QtGui.QPalette.Highlight, QtGui.QColor("black")
)
le.setPalette(pal)
Upvotes: 1