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

Ui files from QtDesigner not working if i use snake_case and true_property

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Not Evaluated
    • 6.4.2
    • 6.3.1
    • PySide
    • None
    • windows 10/11 python 3.8/3.10 pyside6 6.2/6.3
    • Windows

    Description

      In short if i use snake_case and true_property in pyDBManager.py i get this error:

      Traceback (most recent call last):
      File "C:\PyWare\pyDBManager\Bug\pyDBManager.py", line 161, in <module>
      window = MainWindow()
      File "C:\PyWare\pyDBManager\Bug\pyDBManager.py", line 56, in _init_
      self.ui.setupUi(self)
      File "C:\PyWare\pyDBManager\Bug\DBManagerMainWindowBad.py", line 132, in setupUi
      self.gridLayout.setContentsMargins(0, 0, 0, 0)
      AttributeError: 'PySide6.QtWidgets.QGridLayout' object has no attribute 'setContentsMargins'. Did you mean: 'getContentsMargins'?

       

      I attached 7 files:

      DBManagerMainWindowGood.ui created with QtDesigner

      DBManagerMainWindowBad.ui same file with some extra widgets

      DBManagerMainWindowGood.py and DBManagerMainWindowBad.py are generated from pyside6-uic using the batch file.

      PyDBManager.py has an optional import line:

      #from DBManagerMainWindowGood import Ui_DBManagerMainWindow
      from DBManagerMainWindowBad import Ui_DBManagerMainWindow

      When i import the DBManagerMainWindowBad.py file i get the error shown. If i use the DBManagerMainWindowGood.py everithing works.

      BUT if i use the PyDBManagerB.py script both import works correctly. The only difference is that the PyDBManagerB.py is not using snake_case and true_property.

      Attachments

        1. DBManagerMainWindowBad.py
          16 kB
        2. DBManagerMainWindowBad.ui
          10 kB
        3. DBManagerMainWindowGood.py
          13 kB
        4. DBManagerMainWindowGood.ui
          8 kB
        5. makeall.bat
          0.2 kB
        6. pyDBManager.py
          7 kB
        7. pyDBManagerB.py
          7 kB
        8. pyside1981.zip
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            crmaurei Cristian Maureira-Fredes
            xpaolo Paolo De Stefani
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes