Overriding QPaintEvents in PyQt

后端 未结 1 705
一整个雨季
一整个雨季 2021-01-13 01:26

I\'m trying to create a TextEdit widget that will have a delimiter line. As a start, I\'ve created a MyTextEdit class (as a subclass of a QTextEdit

1条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-13 01:50

    If a widget has a viewport, you have to pass that to the QPainter constructor:

    painter = QPainter(self.viewport())
    

    0 讨论(0)
提交回复
热议问题