[PyQt] Foreground and Background Color QToolButton

David Boddie david at boddie.org.uk
Fri Aug 19 01:40:46 BST 2011


On Thu, 18 Aug 2011 06:16:22 +0500, uahmed wrote:

> I want to change the foreground and bankground color of QToolButton , I
> know this can be done using ".setStyleSheet " but i want to use other way
> to do that can it be done through QPlatter i search it on net i do find
> examples of .setStyleSheet but not through any other way .

You need to try using QPalette to change the palette of the button.
This example isn't exactly what you need - you should use a QColor instead
of a QLinearGradient - but maybe it will help you to get started:

  http://www.diotavelli.net/PyQtWiki/Windows_with_gradient_backgrounds

David


More information about the PyQt mailing list