Unsolved Is possible to use styleSheets for only one QGraphictsItems
-
Hi
I have a QGraphicsView for QGraphicsScene . I have multiple QGraphicsItems in form of rectangles . In my case I have to make only one rectangle filled with horizontal and vertical linesCan some one suggest a solution . is it also possible to use only QStyleSheets for one Qgraphicsitem
-
@Qt-Enthusiast
yes it is, you can add the objectname as a specification:QWidget#ObjectName{my StyleSheet parameter }
-
any better solutions
-
@Qt-Enthusiast What is wrong with what @J-Hilk suggested?
-
@Qt-Enthusiast said in Is possible to use styleSheets for only one QGraphictsItems:
is it also possible to use only QStyleSheets for one Qgraphicsitem
no, since QtSytleSheets are only applicable for QWidgets (what actually also @J-Hilk example shows). QGraphicsItems do not get polished by QStyle at all.
The only possible solution is to set a custom style property on the QGraphicsView and use it for painting in the rectangle item. But no direct styling possible.
-
What is the best way to distinguish the a single QGraphicsItem from other QGraphicsitems in the QGraphicsView
I cannot change he color as well style any other way any one can suggest , Will inserting a image will help