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

shiboken2 OverflowError exceeds limits of type with AlignmentFlag enum

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 5.13.2
    • PySide, Shiboken
    • None
    • python3.11.1,
      shiboken2==5.13.2,
      PySide2==5.13.2,
      MacOS Ventura 13.4 x86_64
    • macOS

    Description

      Hello, there seems to be some enum casting going on that confuses shiboken.

      role = QtCore.Qt.ItemDataRole.TextAlignmentRole
      val = QtCore.Qt.AlignmentFlag.AlignCenter
      item.setData(val, role)

      gives the traceback:

      RuntimeWarning: libshiboken: Overflow: Value PySide2.QtCore.Qt.AlignmentFlag.AlignCenter exceeds limits of type  [signed] "i" (4bytes).
        item.setData(val, role)
      OverflowError 

      ...but an integer value (132) directly works:

      item.setData(int(val), role) 

      This seems like it's the same thing as the QGraphicsRectItem() issue in: https://bugreports.qt.io/browse/PYSIDE-648

      Attachments

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

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            eyeteajay I J
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes