summaryrefslogtreecommitdiffstats
path: root/sources/pyside2/libpyside/pysideslot.cpp
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-02 11:16:50 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-02 13:40:10 +0000
commit2827dca2c076d03e8ea46be562e455bd286ad21a (patch)
tree329017a5f9afc4112260d483f6703f2b09524606 /sources/pyside2/libpyside/pysideslot.cpp
parentdb4c54756088c59e35cbe4f64bd35d7aa43f8c56 (diff)
libpyside: Refactor code building the signature
The function slotCall() used the now deprecated function QString::sprintf(). Rewrite the code using QByteArray since converting to QString and back is wasteful for the purpose. Change-Id: Ifcd50e76bb7ea0c9d2f2e7453c6e265abe6265b7 Reviewed-by: Christian Tismer <tismer@stackless.com>
Diffstat (limited to 'sources/pyside2/libpyside/pysideslot.cpp')
-rw-r--r--sources/pyside2/libpyside/pysideslot.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/sources/pyside2/libpyside/pysideslot.cpp b/sources/pyside2/libpyside/pysideslot.cpp
index 6f6658cf..694b5b59 100644
--- a/sources/pyside2/libpyside/pysideslot.cpp
+++ b/sources/pyside2/libpyside/pysideslot.cpp
@@ -147,10 +147,10 @@ PyObject *slotCall(PyObject *self, PyObject *args, PyObject * /* kw */)
data->slotName = strdup(Shiboken::String::toCString(funcName));
}
-
- QByteArray returnType = QMetaObject::normalizedType(data->resultType);
- QByteArray signature = QString().sprintf("%s(%s)", data->slotName, data->args).toUtf8();
- signature = returnType + " " + signature;
+ const QByteArray returnType = QMetaObject::normalizedType(data->resultType);
+ const QByteArray signature =
+ returnType + ' ' + const_cast<const char *>(data->slotName)
+ + '(' + const_cast<const char *>(data->args) + ')';
if (!pySlotName)
pySlotName = Shiboken::String::fromCString(PYSIDE_SLOT_LIST_ATTR);