On Sat, Feb 11, 2012 at 4:05 AM, Aaron Richiger <[email protected]> wrote:
> Hello!
>
> There are different ways to do this! I do not use this very often, and there
> are probably better ways then in the code below... Using 'setStyleSheet()'
> is possible for all widgets, but it often makes widgets looking 'old style',
> at least on my system. Using setPalette() seems much better for me, you can
> test both possibilities with the code below:
>
>
>
> from PySide.QtGui import *
> from PySide.QtCore import *
> import sys
>
> app = QApplication(sys.argv)
> model = QFileSystemModel()
>
> model.setRootPath(QDir.currentPath())
> tree =  QTreeView()
> tree.setModel(model)
> red = QBrush(Qt.red)
> green = QBrush(Qt.green)
> tree.setPalette(QPalette(red, red, red, red, red, green, green, red, red))
> # tree.setStyleSheet("background-color:red")

Aaron, this works! thanks so much!

Jun
_______________________________________________
PySide mailing list
[email protected]
http://lists.pyside.org/listinfo/pyside

Reply via email to