aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-04 10:27:49 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2020-09-04 11:04:04 +0000
commit5e731b27960848348250c9994f2c36c3a67c1565 (patch)
tree05a4018c517b042af0907ef2e93b871c5f9d776f
parenta17f4a90b1af174b38b839fc1b5bc0e933ad1725 (diff)
Add QKeyCombination
Rewrite __repr__ of QKeySequence to use QDebug since its operator[] now returns QKeyCombination. Added by qtbase/25351dcc549f1daddf5e2ae8a242191174342a3e. Task-number: PYSIDE-1339 Task-number: PYSIDE-904 Change-Id: Ia779b25385fff2192ff127e3898a365ed5e44863 Reviewed-by: Christian Tismer <tismer@stackless.com>
-rw-r--r--sources/pyside2/PySide2/QtGui/CMakeLists.txt1
-rw-r--r--sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml7
-rw-r--r--sources/pyside2/PySide2/templates/gui_common.xml9
3 files changed, 12 insertions, 5 deletions
diff --git a/sources/pyside2/PySide2/QtGui/CMakeLists.txt b/sources/pyside2/PySide2/QtGui/CMakeLists.txt
index e6d33d611..f8479fcdb 100644
--- a/sources/pyside2/PySide2/QtGui/CMakeLists.txt
+++ b/sources/pyside2/PySide2/QtGui/CMakeLists.txt
@@ -74,6 +74,7 @@ ${QtGui_GEN_DIR}/qinputmethodevent_attribute_wrapper.cpp
${QtGui_GEN_DIR}/qinputmethodevent_wrapper.cpp
${QtGui_GEN_DIR}/qinputmethodqueryevent_wrapper.cpp
${QtGui_GEN_DIR}/qintvalidator_wrapper.cpp
+${QtGui_GEN_DIR}/qkeycombination_wrapper.cpp
${QtGui_GEN_DIR}/qkeyevent_wrapper.cpp
${QtGui_GEN_DIR}/qkeysequence_wrapper.cpp
${QtGui_GEN_DIR}/qlineargradient_wrapper.cpp
diff --git a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
index 69a3032dd..f8716b727 100644
--- a/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
+++ b/sources/pyside2/PySide2/QtGui/typesystem_gui_common.xml
@@ -336,6 +336,7 @@
<object-type name="QInputMethod">
<enum-type name="Action"/>
</object-type>
+ <value-type name="QKeyCombination"/>
<value-type name="QKeySequence">
<enum-type name="SequenceFormat"/>
<enum-type name="SequenceMatch"/>
@@ -343,11 +344,7 @@
<add-function signature="__repr__" return-type="PyObject*">
<inject-code class="target" position="beginning">
- <insert-template name="repr_code">
- <replace from="%REPR_FORMAT" to="%i, %i, %i, %i"/>
- <replace from="%REPR_ARGS"
- to="(*%CPPSELF)[0], (*%CPPSELF)[1], (*%CPPSELF)[2], (*%CPPSELF)[3]"/>
- </insert-template>
+ <insert-template name="qkeysequence_repr"/>
</inject-code>
</add-function>
diff --git a/sources/pyside2/PySide2/templates/gui_common.xml b/sources/pyside2/PySide2/templates/gui_common.xml
index a139a5fe9..7cedd5af9 100644
--- a/sources/pyside2/PySide2/templates/gui_common.xml
+++ b/sources/pyside2/PySide2/templates/gui_common.xml
@@ -125,6 +125,15 @@
}
</template>
+ <template name="qkeysequence_repr">
+ QString result;
+ QDebug debug(&amp;result);
+ debug.noquote();
+ debug.nospace();
+ debug &lt;&lt; (*%CPPSELF);
+ %PYARG_0 = Shiboken::String::fromCString(result.toUtf8().constData());
+ </template>
+
<template name="validator_conversionrule">
QValidator::State %out;