QGraphicsPolygonItem Opacity

  • Hi everybody,

    I would like to know if there were any changes in the opacity behavior between Qt4 and Qt5.

    I didn't handle the migration so not sure if it is related to Qt or the app's code but here is the problem :

    It seems that on previous releases (running on Qt4.8), the behavior was the following (reproduced by substracting polygons at intersection)


    now (Qt 5.5.1), the behavior is more realistic, but not what the users want (users are professors that need to mark several times the same word, wihtout hiding it for example)


    my question is : is this change related to an evolution of Qt in opacity handling ? If not, I know I have to search for any related change in the hundreds of commits between the two releases so ... please tell me this is due to a Qt evol :)

    Thanks a lot !

  • Moderators

    @kamui said in QGraphicsPolygonItem Opacity:

    I didn't handle the migration so not sure if it is related to Qt or the app's code but here is the problem

    then it's even harder to say.
    I am not aware of such regression.
    But it seems that in the first screenshot the paths are combined, where in the second one they are 2 different shapes painted over each other.

  • The point is that in the first screenshot (the previous behavior, wanted by users), a semi-transparent path overlapping another semi-transparent path resulted on an intersected area with the same semi-transparency (say 0.5).

    Now, the intersected area is less transparent, as it is the combination of the two semi-opaque polygons (so transparency value is now 0.25).. what I want to figure out is "is this change related to Qt4->Qt5 migration of the app or not ?". I guess I will not escape from a minimal code in both Qt versions...

  • the difference is due to a modification of the Composition Mode of the QPaineter wich was painting the objects (QPainter::QCompositionMode_Darken on the first screenshot and QPainter::QCompositionMode_SourceOver on the second one)

    So not an evolution of Qt painting behavior, but a modification of the app's code.

Log in to reply

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.