I'm not sure if it's possible, but I would like to achive something like this:
I have a class that inherits QWidget, it uses paintEvent to draw some text and rectangles, what I would like to achive is get color of text and those rectangles from style sheet.
Pseudocode:
C++
QColor color
= this
->getStyleSheet
().
getClass('MyWidget').
getProperty('color');
QColor color = this->getStyleSheet().getClass('MyWidget').getProperty('color');
To copy to clipboard, switch view to plain text mode
CSS
.MyWidget {
color: #cdcdcd;
}
.MyWidget {
color: #cdcdcd;
}
To copy to clipboard, switch view to plain text mode
Is it possible to do in QT or do I have to store colors and other style information some other way?
Bookmarks