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

Slashes in promoted widget paths broken in pyside2-uic 5.14

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P2: Important
    • Resolution: Done
    • Affects Version/s: 5.14.0, 5.14.1
    • Fix Version/s: None
    • Component/s: Tooling
    • Labels:
      None
    • Platform/s:
      Linux/X11
    • Commits:
      de1d51a3fd69a4961816ecfc3982424d5379a00f (qt/qtbase/5.14)

      Description

      In the attached mainwindow.ui, a QWidget within a QMainWindow has been promoted to a custom widget Bar as follows:

      Using pyside2-uic 5.14.1 to process mainwindow.ui produces import statements with syntax errors (the slashes are not converted to dots):

      (testenv) estan@edison:~/testcase$ pyside2-uic -v
      uic 5.14.1
      (testenv) estan@edison:~/testcase$ pyside2-uic -o mainwindow_ui.py mainwindow.ui 
      (testenv) estan@edison:~/testcase$ grep "import Bar" mainwindow_ui.py 
      from foo/bar import Bar
      

      Using pyside2-uic 5.13.2, the slashes are converted to dots, resulting in valid syntax:

      (testenv) estan@edison:~/testcase$ pip install PySide2==5.13.2
      Collecting PySide2==5.13.2
        Downloading https://files.pythonhosted.org/packages/ea/58/e5a1aa7417f87987f03f02c0d0ce4bb1112ae9981667107ee9a1560f3607/PySide2-5.13.2-5.13.2-cp35.cp36.cp37-abi3-manylinux1_x86_64.whl (156.1MB)
          100% |████████████████████████████████| 156.1MB 11kB/s 
      Collecting shiboken2==5.13.2 (from PySide2==5.13.2)
        Downloading https://files.pythonhosted.org/packages/31/90/7d22091d25492af3c49f47dd255c761b45c1b93e60e164d8007ed2146758/shiboken2-5.13.2-5.13.2-cp35.cp36.cp37-abi3-manylinux1_x86_64.whl (832kB)
          100% |████████████████████████████████| 839kB 2.0MB/s 
      Installing collected packages: shiboken2, PySide2
        Found existing installation: shiboken2 5.14.1
          Uninstalling shiboken2-5.14.1:
            Successfully uninstalled shiboken2-5.14.1
        Found existing installation: PySide2 5.14.1
          Uninstalling PySide2-5.14.1:
            Successfully uninstalled PySide2-5.14.1
      Successfully installed PySide2-5.13.2 shiboken2-5.13.2
      (testenv) estan@edison:~/testcase$ pyside2-uic -o mainwindow_ui.py mainwindow.ui 
      (testenv) estan@edison:~/testcase$ grep "import Bar" mainwindow_ui.py 
      from foo.bar import Bar
      (testenv) estan@edison:~/testcase$
      

        Attachments

        1. mainwindow.ui
          1 kB
        2. promotion.png
          promotion.png
          47 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            crmaurei Cristian Maureira-Fredes
            Reporter:
            estan Elvis Stansvik
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes