Setting a QSS style on all QToolButtons in an application except the ones inside a QToolBar

45 views Asked by At

The application I am working on uses QToolButtons as simple elements in a layout and as QActions added to QToolBars. I would like to apply a style on all the QToolButtons in my application except the ones within a QToolBar. I saw that I can set a style on all QToolButtons with the entry:

QToolButton{ background-color: rgb(255, 0, 0); }

And I can apply a style for all the QToolButtons inside a QToolBar using:

QToolBar > QToolButton { background-color: rgb(0, 255, 0); }

But how can I perform the required styling without adding a style entry for the buttons in QToolBar, so that they would still have the default styling?

0

There are 0 answers