aboutsummaryrefslogtreecommitdiffstats
path: root/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
diff options
context:
space:
mode:
authorAdrian Herrmann <adrian.herrmann@qt.io>2024-01-31 18:03:36 +0100
committerAdrian Herrmann <adrian.herrmann@qt.io>2024-02-13 13:28:49 +0100
commit194e040570d4d3727b983d93b0e7a4957348a27c (patch)
treeec962fdaa7ff4fe0fffff7c506b9cf9778e5602b /sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
parentb806c5e75e89fbe0a3fc53eb82ca1b27524cca69 (diff)
QTimer: Call C++ function for singleShot timers
The current implementation of singleshot timers is very old and bypasses the C++ function. Instead, a timer object is manually created and started. This incurs a performance penalty, as this bypasses the optimized code path for 0 timers that eschews a timer object in favor of directly calling QMetaObject::invokeMethod. This is now fixed, and for 0 timers, the C++ function is called directly. Change-Id: Idfed06d60eb34355242818ac2df46f75dd27353c Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Cristian Maureira-Fredes <cristian.maureira-fredes@qt.io>
Diffstat (limited to 'sources/pyside6/PySide6/QtCore/typesystem_core_common.xml')
-rw-r--r--sources/pyside6/PySide6/QtCore/typesystem_core_common.xml6
1 files changed, 3 insertions, 3 deletions
diff --git a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
index d51a80380..f7235ffc2 100644
--- a/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
+++ b/sources/pyside6/PySide6/QtCore/typesystem_core_common.xml
@@ -2542,10 +2542,10 @@
<include file-name="pysidestaticstrings.h" location="global"/>
</extra-includes>
<modify-function signature="singleShot(int,const QObject*,const char*)">
- <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qtimer-singleshot-1"/>
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qtimer-singleshot-direct-mapping"/>
</modify-function>
- <add-function signature="singleShot(int,PyCallable*)" static="yes">
- <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qtimer-singleshot-2"/>
+ <add-function signature="singleShot(int@msec@,PyCallable*@functor@)" static="yes">
+ <inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qtimer-singleshot-functor"/>
</add-function>
<add-function signature="singleShot(int@msec@,const QObject*@context@,PyCallable*@functor@)" static="yes">
<inject-code class="target" position="beginning" file="../glue/qtcore.cpp" snippet="qtimer-singleshot-functor-context"/>