Uploaded image for project: 'Qt for Python'
  1. Qt for Python
  2. PYSIDE-2068

QPainter.drawText signatures are incorrect

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.3.1
    • PySide
    • None

      The following signature doesn't reflect the C++ signature.

      def drawText(self, r:Union[PySide6.QtCore.QRectF, PySide6.QtCore.QRect], flags:int, text:str, br:Union[PySide6.QtCore.QRectF, PySide6.QtCore.QRect]) -> None: ...

      Also any calls to this function with the `br` argument specified result in the following exception: 

      ValueError: 'PySide6.QtGui.QPainter.drawText' called with wrong argument values:
        PySide6.QtGui.QPainter.drawText(PySide6.QtCore.QRectF(5.000000, 5.000000, 200.000000, 200.000000), 132, 'Label', PySide6.QtCore.QRectF(0.000000, 0.000000, 0.000000, 0.000000))
      Found signature:
        PySide6.QtGui.QPainter.drawText(Union[PySide6.QtCore.QRectF, PySide6.QtCore.QRect], int, str, Union[PySide6.QtCore.QRectF, PySide6.QtCore.QRect])
      

       
      You can reproduce it with this snippet:
       

      from PySide6 import QtCore, QtGui, QtWidgetspainter = QtGui.QPainter()r = QtCore.QRectF(5.0, 5.0, 200.0, 200.0)painter.drawText(r, int(QtCore.Qt.AlignCenter), "Label", QtCore.QRectF())
      

       

      QPainter::drawText(int x, int y, int width, int height, int flags, 
            const QString &text, QRect *boundingRect = nullptr);
       

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            crmaurei Cristian Maureira-Fredes
            viktor-refeyn Viktor Verebelyi
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes