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

snake_case and true_property both break property keywords in widget constructors

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • Not Evaluated
    • None
    • 6.2.0
    • PySide
    • None
    • 1fbcc4f972 (pyside/pyside-setup/dev) 4489c5249e (pyside/pyside-setup/6.2) 4489c5249e (pyside/tqtc-pyside-setup/6.2) 1fbcc4f972 (pyside/tqtc-pyside-setup/dev) 4489c5249e (pyside/pyside-setup/6.2.4) 4489c5249e (pyside/tqtc-pyside-setup/6.2.4)

    Description

      Importing true_property or snake_case produce (different) errors when attempting to provide a Qt property via keyword argument to a widget constructor. Example for snake_case:

      from PySide6 import QtWidgets
      from __feature__ import snake_case
      
      app = QtWidgets.QApplication()
      text = QtWidgets.QLabel('Example', margin=10)
      

      Result:

      AttributeError: PySide6.QtWidgets.QLabel.__init__(): 'margin' is not a Qt property or a signal
      

      And for true_property:

      from PySide6 import QtWidgets
      from __feature__ import true_property
      
      # Same result from:
      # from __feature__ import snake_case, true_property
      # from __feature__ import true_property, snake_case
      
      app = QtWidgets.QApplication()
      text = QtWidgets.QLabel('Example', margin=10)
      
      Segmentation fault: 11
      

      The first of these two was mentioned in the now-closed PYSIDE-1483, but I couldn't find the other reported anywhere yet.

      Attachments

        Issue Links

          For Gerrit Dashboard: PYSIDE-1705
          # Subject Branch Project Status CR V

          Activity

            People

              ctismer Christian Tismer
              charleswhitt Charles Whittington
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes