diff options
author | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-03-12 18:26:12 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@qt.io> | 2021-03-15 08:24:13 +0100 |
commit | 4aba6db31495ba07226b93ddd601a6b38e2df0f9 (patch) | |
tree | 093686df2945c0018aa9b638887b320119a6f8f5 /sources/pyside6 | |
parent | 31be0cfd47643204b32e5192fb18ee2cfc152c9d (diff) |
Remove const_cast<char *> which are no longer needed in Python 3
Remove from code as well as from the generator.
Change-Id: Ia863788bfa57d52258836c1cbcccb8c9815b7421
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside6')
-rw-r--r-- | sources/pyside6/PySide6/glue/qtcore.cpp | 12 | ||||
-rw-r--r-- | sources/pyside6/PySide6/glue/qtgui.cpp | 4 | ||||
-rw-r--r-- | sources/pyside6/PySide6/glue/qtwidgets.cpp | 14 |
3 files changed, 8 insertions, 22 deletions
diff --git a/sources/pyside6/PySide6/glue/qtcore.cpp b/sources/pyside6/PySide6/glue/qtcore.cpp index b0d47606e..0d70391cf 100644 --- a/sources/pyside6/PySide6/glue/qtcore.cpp +++ b/sources/pyside6/PySide6/glue/qtcore.cpp @@ -1238,9 +1238,7 @@ timerType->tp_init(pyTimer, emptyTuple, nullptr); auto timer = %CONVERTTOCPP[QTimer *](pyTimer); //XXX /|\ omitting this space crashes shiboken! Shiboken::AutoDecRef result( - PyObject_CallMethod(pyTimer, - const_cast<char *>("connect"), - const_cast<char *>("OsOs"), + PyObject_CallMethod(pyTimer, "connect", "OsOs", pyTimer, SIGNAL(timeout()), %PYARG_2, @@ -1266,9 +1264,7 @@ if (PyObject_TypeCheck(%2, PySideSignalInstanceTypeF())) { PySideSignalInstance *signalInstance = reinterpret_cast<PySideSignalInstance *>(%2); Shiboken::AutoDecRef signalSignature(Shiboken::String::fromFormat("2%s", PySide::Signal::getSignature(signalInstance))); Shiboken::AutoDecRef result( - PyObject_CallMethod(pyTimer, - const_cast<char *>("connect"), - const_cast<char *>("OsOO"), + PyObject_CallMethod(pyTimer, "connect", "OsOO", pyTimer, SIGNAL(timeout()), PySide::Signal::getObject(signalInstance), @@ -1276,9 +1272,7 @@ if (PyObject_TypeCheck(%2, PySideSignalInstanceTypeF())) { ); } else { Shiboken::AutoDecRef result( - PyObject_CallMethod(pyTimer, - const_cast<char *>("connect"), - const_cast<char *>("OsO"), + PyObject_CallMethod(pyTimer, "connect", "OsO", pyTimer, SIGNAL(timeout()), %PYARG_2) diff --git a/sources/pyside6/PySide6/glue/qtgui.cpp b/sources/pyside6/PySide6/glue/qtgui.cpp index 76932c07b..c0323ad0f 100644 --- a/sources/pyside6/PySide6/glue/qtgui.cpp +++ b/sources/pyside6/PySide6/glue/qtgui.cpp @@ -547,9 +547,7 @@ WId id = %1; // @snippet qshortcut-1 // @snippet qshortcut-2 -Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, - const_cast<char *>("connect"), - const_cast<char *>("OsO"), +Shiboken::AutoDecRef result(PyObject_CallMethod(%PYSELF, "connect", "OsO", %PYSELF, SIGNAL(activated()), %PYARG_3) ); if (!result.isNull()) diff --git a/sources/pyside6/PySide6/glue/qtwidgets.cpp b/sources/pyside6/PySide6/glue/qtwidgets.cpp index b4a97c7b9..f41bc7616 100644 --- a/sources/pyside6/PySide6/glue/qtwidgets.cpp +++ b/sources/pyside6/PySide6/glue/qtwidgets.cpp @@ -120,9 +120,7 @@ inline PyObject *addActionWithPyObject(QMenu *self, const QIcon &icon, const QSt self->addAction(act); PyObject *pyAct = %CONVERTTOPYTHON[QAction *](act); - Shiboken::AutoDecRef result(PyObject_CallMethod(pyAct, - const_cast<char *>("connect"), - const_cast<char *>("OsO"), + Shiboken::AutoDecRef result(PyObject_CallMethod(pyAct, "connect", "OsO", pyAct, SIGNAL(triggered()), callback)); if (result.isNull()) { @@ -169,9 +167,7 @@ addActionWithPyObject(QMenuBar *self, const QString &text, PyObject *callback) self->addAction(act); PyObject *pyAct = %CONVERTTOPYTHON[QAction *](act); - PyObject *result = PyObject_CallMethod(pyAct, - const_cast<char *>("connect"), - const_cast<char *>("OsO"), + PyObject *result = PyObject_CallMethod(pyAct, "connect", "OsO", pyAct, SIGNAL(triggered(bool)), callback); @@ -573,8 +569,7 @@ for (int i = 0, count = %CPPSELF.count(); i < count; ++i) { QAction *action = %CPPSELF.addAction(%1, %2); %PYARG_0 = %CONVERTTOPYTHON[QAction *](action); Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0, - const_cast<char *>("connect"), - const_cast<char *>("OsO"), + "connect", "OsO", %PYARG_0, SIGNAL(triggered()), %PYARG_3) ); // @snippet qtoolbar-addaction-1 @@ -583,8 +578,7 @@ Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0, QAction *action = %CPPSELF.addAction(%1); %PYARG_0 = %CONVERTTOPYTHON[QAction *](action); Shiboken::AutoDecRef result(PyObject_CallMethod(%PYARG_0, - const_cast<char *>("connect"), - const_cast<char *>("OsO"), + "connect", "OsO", %PYARG_0, SIGNAL(triggered()), %PYARG_2) ); // @snippet qtoolbar-addaction-2 |