Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

[SOLVED]can i set the percent of fill while keep the outline static while use a custom QGraphicsPolygonItem ?



  • i inherite a class from QGraphicsPolygonItem.
    i now want to keep the outline static, meanwhile, i want to make the fill content dynamically changed.
    eg. the fill color is only the half height, while the outline color is still there.
    and i found that there can be only 1 QPolygonF in the class.



  • Either creator your own QGraphicsItem and implement paint as you need it, or create two items: One for the outline, one for the fill area.



  • ok, got it


Log in to reply