Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.3.0
-
None
-
OS: All
PySide/PyQt: Next release
-
-
61834a7895db65e56434ca9c463b61e1fd40b71e
Description
Moderators: A "New Feature" issue type may be more appropriate, but this was not available to me.
C++ doesn't natively support keyword arguments, but Python does. Calls to `Qt` functions from `PyQt` return a "no matching signature" or "not enough arguments" error when keywords are used. This is confusing for newcomers, especially if they are calling a function correctly but are otherwise unaware that keyword arguments are not supported.
Would it be possible to wrap `Qt` calls in the python bindings so keyword arguments are supported?
# keyPress(QWidget *widget, Qt::Key key, Qt::KeyboardModifiers modifier = Qt::NoModifier, int delay = -1) # Works: keyword parameter for optional argument QTest.keyPress(window, Qt.Key_Q, modifier=Qt.ControlModifier) # # Does not work QTest.keyPress(widget=window, key=Qt.Key_Q, modifier=Qt.ControlModifier) QTest.keyPress(widget=window, key=Qt.Key_Q, modifier=Qt.ControlModifier) TypeError: PySide6.QtTest.QTest.keyPress(): not enough arguments
Attachments
Issue Links
- is duplicated by
-
PYSIDE-2809 QRect ignores named arguments
- Closed
Gerrit Reviews
For Gerrit Dashboard: PYSIDE-1964 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
416342,2 | libshiboken: Amend error message "not enough arguments" | dev | pyside/pyside-setup | Status: MERGED | +2 | 0 |
416627,2 | libshiboken: Amend error message "not enough arguments" | 6.3 | pyside/pyside-setup | Status: MERGED | +2 | 0 |
416629,1 | libshiboken: Amend error message "not enough arguments" | tqtc/lts-6.2 | pyside/tqtc-pyside-setup | Status: ABANDONED | 0 | 0 |