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

Autocompletion/argument type limitations

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P3: Somewhat important
    • Resolution: Done
    • Affects Version/s: 5.13.0
    • Fix Version/s: 5.13.1
    • Component/s: PySide
    • Labels:
      None
    • Environment:
      I develop under Ubuntu 19.04, but I don't think that's relevant.
    • Platform/s:
      Linux/X11
    • Commits:
      d4acbacd7a655e3ff9e17663a23ed0d822b84850 (pyside/pyside-setup/5.13.1)

      Description

      I am trying to move over from PyQt5 to PySide2.  I use PyCharm as my editor/IDE.  As I get going I am noticing problems/limitations with PySide2 autocompletion and argument type warnings from the PyCharm editor.  I am not using any PyQt-aware extensions in PyCharm editing, so I believe they must emanate from differences in how PySide2 exposes its library to the editor.  I do not claim to understand how that works.

      Let's take a couple of fundamental examples I have immediately encountered:

       

      from PySide2 import QtCore, QtWidgets

      btnModeless = QtWidgets.QPushButton("Open Modeless", None)

      btnModeless.clicked.connect(...)

       

      1. PyCharm highlights and warns on the None passed as parent to any QWidget constructor, such as QPushButton.  It says its type must be QWidget.  This leaves code covered in warning highlights.
      2. PyCharm cannot find anything for the btnModeless.clicked (nor for other signals).  It will not offer clicked as a member to select in completion on btnModeless/QPushButton, nor anything after the clicked. (since it doesn't recognise the clicked).

       

      The code itself runs fine using PySide2 instead of PyQt5, and if I import from PyQt5 instead I do not get the warning from #1 and I do get the completions from #2.

      I could go on and enumerate more similar issues, but these will do to start with.  They may or may not seem small, but these sorts of editing issues make all the difference to me as developer.  I'd like to move to PySide2, but cannot if these are typical of the issues I will encounter.

      How/where do editors get this information for argument types, completion methods, etc.?  There must be something supplied with PySide2 which is different from PyQt5.  Are my expectations unrealistic?  Is anybody in the PySide2 interested in addressing these, ior will they remain more or less as-is?  Because for my part I'm more interested in this sort of fundamental experience being sorted out in PySide2 than any amount of new features you might be wanting to add to PySide2.

       

       

       

        Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            • Assignee:
              ctismer Christian Tismer
              Reporter:
              jonbrave J Barchan
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Gerrit Reviews

                There are no open Gerrit changes