0
정적 텍스트를 그리지 만 오류가 발생하면서 내가 뭘 잘못하고 있는지 설명 할 수 있습니까?drawStaticText에서 오류가 발생합니다.
sT = QtGui.QStaticText()
text = 'text'
painter.drawStaticText(QtCore.QPoint(40, 50), sT.setText(text))
및 오류 :
painter.drawStaticText(QtCore.QPoint(40, 50), staticT.setText(text))
TypeError: arguments did not match any overloaded call:
QPainter.drawStaticText(QPointF, QStaticText): argument 2 has unexpected type 'NoneType'
QPainter.drawStaticText(QPoint, QStaticText): argument 2 has unexpected type 'NoneType'
QPainter.drawStaticText(int, int, QStaticText): argument 1 has unexpected type 'QPoint'
감사합니다 여기
는 코드입니다.
두 단계 - 먼저'sT.setText (text)'와 나중에'drawStaticText (QtCore.QPoint (40, 50), sT)' – furas