[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    PyQt6 QFormLayout and uic
From:       Timmy Welch <timmy () narnian ! us>
Date:       2021-11-14 20:14:32
Message-ID: CAHdkYqURnmOxdPt_Z9GAXjmfDqLQMNq948HvBi4M-gobJiGB5Q () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello,
I am trying to convert a python app from PyQt5 to PyQt6 and I am using
the uic module to load the GUI.
However uic fails loading when I have either the layoutFieldGrowthPolicy or
rowWrapPolicy fields set on a QFormLayout, attached is an example ui file
that fails when ran with 'pyuic6 -p' and the output from 'pyuic6 --debug
-p'.
From my own investigation into the issue it appears that these enums need
to be added to PyQt6/uic/enum_map.py.

Any assistance would be appreciated.

-Timmy

[Attachment #5 (text/html)]

<div dir="ltr">Hello,<div>I am trying to convert a python app from PyQt5 to PyQt6 and \
I am using the  uic module to load the GUI.</div><div>However uic fails loading when \
I have either the layoutFieldGrowthPolicy or rowWrapPolicy fields set on a \
QFormLayout, attached is an example ui file that fails when ran with &#39;pyuic6 \
-p&#39; and the output from &#39;pyuic6 --debug -p&#39;.</div><div>From my own \
investigation into the issue it appears that these enums need to be added to \
PyQt6/uic/enum_map.py.</div><div><br></div><div>Any assistance would be \
appreciated.</div><div><br></div><div>-Timmy</div></div>


["terminal-output.txt" (text/plain)]

(venv) timmywelch@Timmys-Mac-mini comictagger % pyuic6 -p \
comictaggerlib/ui/untitled.ui An unexpected error occurred.
Check that you are using the latest version of pyuic6 and send an error report
to the PyQt mailing list and include the following information:

- your version of pyuic6 (6.2.1)
- the .ui file that caused this error
- the debug output of pyuic6 (use the --debug flag when calling pyuic6)
zsh: exit 1     pyuic6 -p comictaggerlib/ui/untitled.ui
(venv) timmywelch@Timmys-Mac-mini comictagger % pyuic6 --debug -p \
                comictaggerlib/ui/untitled.ui
PyQt6.uic.uiparser: toplevel widget is QMainWindow
PyQt6.uic.properties: setting property geometry
PyQt6.uic.properties: setting property windowTitle
PyQt6.uic.uiparser: push QMainWindow MainWindow
PyQt6.uic.uiparser: push QWidget centralwidget
PyQt6.uic.properties: setting property geometry
PyQt6.uic.uiparser: push QWidget formLayoutWidget
PyQt6.uic.properties: setting property fieldGrowthPolicy
Traceback (most recent call last):
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/pyuic.py", \
line 67, in main  exit_status = preview(args.ui)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/pyuic.py", \
line 143, in preview  ui = loadUi(ui_file)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/load_ui.py", \
line 86, in loadUi  return DynamicUILoader(package).loadUi(uifile, baseinstance)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/Loader/loader.py", \
line 62, in loadUi  return self.parse(filename)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/uiparser.py", \
line 1000, in parse  self._handle_widget(ui_file.widget)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/uiparser.py", \
line 828, in _handle_widget  self.traverseWidgetTree(el)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/uiparser.py", \
line 804, in traverseWidgetTree  handler(self, child)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/uiparser.py", \
line 271, in createWidget  self.traverseWidgetTree(elem)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/uiparser.py", \
line 804, in traverseWidgetTree  handler(self, child)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/uiparser.py", \
line 271, in createWidget  self.traverseWidgetTree(elem)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/uiparser.py", \
line 804, in traverseWidgetTree  handler(self, child)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/uiparser.py", \
line 500, in createLayout  self.stack.push(self.setupObject(classname, parent, elem))
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/uiparser.py", \
line 228, in setupObject  self.wprops.setProperties(obj, branch)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/properties.py", \
line 430, in setProperties  prop_value = self.convert(prop, widget)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/properties.py", \
line 393, in convert  return func(prop[0], **args)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/properties.py", \
line 141, in _enum  return self._pyEnumMember(prop.text)
  File "/Users/timmywelch/build/source/comictagger/venv/lib/python3.10/site-packages/PyQt6/uic/properties.py", \
line 127, in _pyEnumMember  scope = getattr(scope, tail)
AttributeError: type object 'QFormLayout' has no attribute 'AllNonFixedFieldsGrow'
zsh: exit 1     pyuic6 --debug -p comictaggerlib/ui/untitled.ui


["test.ui" (application/octet-stream)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic