qt 4.5.2: Farbe eines QBrush ändern

Alles rund um die Programmierung mit Qt
Antworten
olebole
Beiträge: 38
Registriert: 20. März 2009 16:39

qt 4.5.2: Farbe eines QBrush ändern

Beitrag von olebole »

Hallo,

aus irgendwelchen Gründen kann ich die Farbe im QBrush nicht ändern
(sorry again for Python code):

Code: Alles auswählen

from PyQt4 import QtGui
app = QtGui.QApplication([])

color = QtGui.QColor('red')
color.setRed(11)
print color.red()

brush = QtGui.QBrush(QtGui.QColor('red'))
brush.color().setRed(11)
print brush.color().red()
Wenn ich "color" direkt verwende, funktioniert setRed() problemlos. Das brush.color().setRed() ist aber offenbar wirkungslos.

Bei qt 4.5.0 funktionierte noch alles wie es sollte.

Warum geht es jetzt nicht mehr und was kann ich da sinnvoll tun? Ich möchte vermeiden, anstelle von setRed() eine neue QColor anlegen zu müssen, weil das deutlich mehr Zeit kostet (die Farbänderung wird pro Update ca. 100.000mal aufgerufen, da macht sich das schon bemerkbar).
Antworten