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