ich möchte die Hintergrundfarbe ändern und versuche es so zu machen:
Code: Alles auswählen
self.textbox = QTextEdit(self)
# set textbox background color
self.textbox.setAutoFillBackground(True)
p2 = self.textbox.palette()
p2.setColor(self.textbox.backgroundRole(), Qt.red)
self.textbox.setPalette(p2)
# set window background color
self.setAutoFillBackground(True)
p1 = self.palette()
p1.setColor(self.backgroundRole(), Qt.darkGray)
self.setPalette(p1)
?