Hello!
Is there a possibility to use Style Sheets alongside QStaticText? Or I'ld have to use QLabel to draw text if I want to take advantage of the Style Sheet system?
Thanks,
Momergil
Hello!
Is there a possibility to use Style Sheets alongside QStaticText? Or I'ld have to use QLabel to draw text if I want to take advantage of the Style Sheet system?
Thanks,
Momergil
May the Lord be with you. Always.
QStaticText is not derived from QObject or QWidget; it is just a container for formatted text that will be drawn by QPainter. So it doesn't support style sheets (which are applied to QWidget classes), but it does support formatted text such as Rich Text.
If you need to use style sheets, then I think you are stuck with QLabel. On the other hand, if you are manually drawing text using QPainter, then you can use QStaticText.
It would be really nice if there was a style sheet to Rich Text format converter, but I don't think there is any such thing, at least not in the documented part of Qt.
Last edited by d_stranz; 26th August 2014 at 03:22.
Momergil (27th August 2014)
Bookmarks