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

Line 62 in uiparser.py has an error

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Invalid
    • Icon: Not Evaluated Not Evaluated
    • None
    • 6.2.0
    • PySide
    • None
    • All

      The error happens when I am using the `loadUi` module which I import from PyQt6.uic .

      The first time when I used the module, the error read `AttributeError: type object 'Qt' has no attribute 'AlignHCenter'`. The fix for this problem was changing Line 62 in the uiparser.py from

      `align = getattr(QtCore.Qt, qt_align)` to `align = getattr(QtCore.Qt.AlignmentFlag, qt_align)` .

      Appending `AlignmentFlag` to the `QtCore.Qt` fixed the issue for me, and I have been able to use the module without issue since. 

      I just thought this is something important to fix, especially when you are using the Designer app to do most of the layouts and then you want to access it programmatically later.

      Thank you for your time, and hope to hear about updates on this.

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

            crmaurei Cristian Maureira-Fredes
            superbluestar Nicholas Matanga
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                There are no open Gerrit changes