Comment 13 for bug 992811

Revision history for this message
RJ Skerry-Ryan (rryan) wrote :

Just tested and this works to style the button:

<Library>
<Style>
QPushButton {
background-color: red;
}
QPushButton:hover {
background-color: green;
}
</Style>
</Library>

I'm also adding object names to a bunch of library widgets so you can style it like:

#LibraryPreviewButton {

}

I'll document all the object-names in the skin wiki page. This way if we have multiple push button delegates you aren't addressing them all by using QPushButton.

BTW it looks like QPushButton supports setting its image via CSS:

QPushButton:pressed { image: url(':images/settings_press.png') }

http://stackoverflow.com/questions/12391125/qpushbutton-css-pressed

The problem is we can't change the image based on the play or pause state of the button via CSS. Maybe we could define a cssClass property for widgets like this so that it could dynamically change its class. That way skins could say

#LibraryPushButton.pause {
  image: url(...);
}

#LibraryPushButton.play {
  image: url(...);
}

Seems possible according to:
http://stackoverflow.com/questions/4596903/css-selector-for-custom-qt-class