PDA

View Full Version : QGraphicsTextItem has no setStylesheet but has setHtml with css styles support



mark_tn
14th October 2010, 14:44
Hi, I think Qss stylesheets are a great feature for QWidgets but it does not exist for QGraphicsItems and I could understand that because QGraphicsitem is used in a QGraphicScene where rendering styles can get tricky.
When I was about to give up trying to style a QGraphicsTextItem i realized that QGraphicsTextItem supports setHtml with all the css styles functions, so basically if you write correct HTML you arrive at the same result that you may have with a QLabel and Qss stylesheet.
So the question is why not use Qss stylesheet for QGraphicstextItems too ?