TriGemini
26th November 2016, 09:13
I want to accomplish the following:
1. I have a CustomView class that inherits the GraphicsView with background style set to being transparent - setStyleSheet("background: transparent")
2. To the CustomView I add a QGraphicsScene and draw a thick Line via scene->addLine
3. Now I want to erase part of the red line, by simply drawing a new line in the scene with a transparent color (to mimick erase of parts of the red line).
Is this possble and how?
I've tried to implement a CustomLine inheriting from a QGraphicsLineItem and implementing the paintevent to play around with compositionmode, however with no usefull result.
1. I have a CustomView class that inherits the GraphicsView with background style set to being transparent - setStyleSheet("background: transparent")
2. To the CustomView I add a QGraphicsScene and draw a thick Line via scene->addLine
3. Now I want to erase part of the red line, by simply drawing a new line in the scene with a transparent color (to mimick erase of parts of the red line).
Is this possble and how?
I've tried to implement a CustomLine inheriting from a QGraphicsLineItem and implementing the paintevent to play around with compositionmode, however with no usefull result.