Hijack QWidget::setStyleSheet for a QObject class (non QWidget) ?
I would like to set multiple properties for my QObjects with the versatile stylesheet syntax. The selecting of particular QObjects in my hierarchies would be essentially very helpfull. I dont want to make all these classes QWidgets (which would make no sense). Is there any way to use the mechanism ?
Sidenote: QDeclerativeContext in 4.6 seems to do a similar thing, but I would prefer to work on the bounds of 4.5.
Thx!
Re: Hijack QWidget::setStyleSheet for a QObject class (non QWidget) ?
Style sheets are meant for widgets only. You can use QObject::findChildren() to find the objects you are interested in and then use QObject::setProperty() to manipulate their properties.