Home > Mobile >  Qt QGraphView transparent item cascade problems
Qt QGraphView transparent item cascade problems

Time:09-16

Ladies and gentlemen, the younger brother when using Qt QGraphView draw each rectangle item is transparent only border is black, when there is a time an item is placed on the top, because is transparent all will see the item at the bottom of the frame, this and do not conform to the demand, how to deal with to make the following item obscured parts of the frame is transparent, as shown:

3 of them in the top, but because is transparent, will see the underlying Item obscured parts of the frame. How to make this part of the frame is the arrow pointing in the direction of the frame is transparent?

CodePudding user response:

Graphview not clear, the painter is a clear pattern, to clear again, drawing again

CodePudding user response:

You the demand contradiction, and transparent, and otherwise transparent block below the z axis, if there are overlapping primitives, thus determine the top do fill opacity with primitives

CodePudding user response:

Item can't do some transparent parts processing, opaque unless you rewrite QGraphicsItem paint function, and then determine whether the item in it toplevel, draw a border around again,

CodePudding user response:

refer to the second floor taitanyt response:
you this demand contradiction, and transparent, and otherwise transparent block below the z axis, if there are overlapping primitives, thus determine the top figure yuan do fill opacity processing

The younger brother is also a headache, practice is a UI layer, the graphics layer, can't put the graphics layer below in the QGraphItem, all such processing, or it will look at the graphics layer is blocked by the border around the QGraphItem,

CodePudding user response:

reference 1st floor Italink response:
graphview unclear, painter is a clear pattern, first clear again, again drawing

Good younger brother to study first

CodePudding user response:

Only in QGraphicsItem paint to paint, or you take the middle area of the color set and scene, this will be covered in the following item, also looks like transparent
  •  Tags:  
  • Qt
  • Related