On Wed, 08 Apr 2009 10:26:18 +0200, TP <[email protected]> wrote: > Hi everybody, > > To color a QDialog (for example), I can do: > > from PyQt4.QtCore import * > from PyQt4.QtGui import * > import sys > app = QApplication( sys.argv ) > dialog = QDialog( ) > dialog.palette().background().setColor(Qt.blue) # @ > dialog.show() > app.exec_() > > But if I replace the line "@" by: > > dialog.setForegroundRole( QPalette().Dark ) > > it seems it does not work: the color is the same with and without this > line. > > What is the problem?
You can't update a palette in-situ, you need to call setPalette() with the modified palette. Phil _______________________________________________ PyQt mailing list [email protected] http://www.riverbankcomputing.com/mailman/listinfo/pyqt
