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

QFlags is not accessible through the QObject.property() method (QVariant)

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P4: Low
    • None
    • 6.1.3
    • PySide
    • None
    • All
    • 292a8e2426b14f98f4863dc58b5bf363ca97e748 (pyside/pyside-setup/dev) 242300c1cd9d0b0eca6114064a24e87b6ea51ab7 (pyside/pyside-setup/6.2)

    Description

      QFlags cannot be accessed via the property method, for example:

      from PySide6.QtWidgets import QApplication, QLabel
      
      app = QApplication()
      
      label = QLabel("Foo")
      print(label.text())
      print(label.alignment())
      
      print(label.property("text"))
      print(label.property("alignment"))
      

      Output:

      Foo
      <PySide6.QtCore.Qt.Alignment object at 0x7f37364cb6f0>
      Foo
      Traceback (most recent call last):
        File "/home/qt/main.py", line 10, in <module>
          print(label.property("alignment"))
      RuntimeError: Can't find converter for 'QFlags<Qt::AlignmentFlag>'.
      

      I am going to attach a demo where other properties are affected.

      Attachments

        1. main.py
          0.9 kB
        2. pyside1673_diag.diff
          1 kB
        3. pyside1673.py
          0.6 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            eyllanesc Edwin Christian Yllanes Cucho
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes