Phil Thompson wrote:

> You can't update a palette in-situ, you need to call setPalette() with the
> modified palette.

Ok, thanks a lot. Like this, it works better:

from PyQt4.QtCore import *
from PyQt4.QtGui import *
import sys

app = QApplication( sys.argv )
dialog = QDialog( )
pal = QPalette()
pal.setColor ( QPalette.Active, QPalette.Window, Qt.blue )
pal.setColor ( QPalette.Inactive, QPalette.Window, Qt.red )
pal.setColor ( QPalette.Active, QPalette.WindowText, Qt.green )
pal.setColor ( QPalette.Inactive, QPalette.WindowText, Qt.yellow )
dialog.setPalette( pal )

vbox = QVBoxLayout()
a = QLabel( "toto" )
a.setPalette( pal )
vbox.addWidget( a )
dialog.setLayout( vbox )
dialog.show()

app.exec_()


-- 
python -c "print ''.join([chr(154 - ord(c)) for c in '*9(9&(18%.\
9&1+,\'Z4(55l4('])"

"When a distinguished but elderly scientist states that something is
possible, he is almost certainly right. When he states that something is
impossible, he is very probably wrong." (first law of AC Clarke)

_______________________________________________
PyQt mailing list    [email protected]
http://www.riverbankcomputing.com/mailman/listinfo/pyqt

Reply via email to