aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4qobjectwrapper.cpp
diff options
context:
space:
mode:
authorZhao Yuhang <2546789017@qq.com>2025-04-10 16:20:35 +0800
committerZhao Yuhang <2546789017@qq.com>2025-04-12 05:39:59 +0000
commit60297d4d1e17705c128d11a1ef6f200e59ba4708 (patch)
treede516f9eb0c35659cd50c1fcd3a52a94ff6f838c /src/qml/jsruntime/qv4qobjectwrapper.cpp
parentfe62a09338be3ca3371988e1645c8e74e36a4818 (diff)
Port away from QPair
QPair is just an alias of std::pair anyway. Task-number: QTBUG-115841 Change-Id: I26fc90adcc775aac9955ad57304af914dc4ed48f Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4qobjectwrapper.cpp')
-rw-r--r--src/qml/jsruntime/qv4qobjectwrapper.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/qml/jsruntime/qv4qobjectwrapper.cpp b/src/qml/jsruntime/qv4qobjectwrapper.cpp
index 87492006e2..f2a7878147 100644
--- a/src/qml/jsruntime/qv4qobjectwrapper.cpp
+++ b/src/qml/jsruntime/qv4qobjectwrapper.cpp
@@ -63,20 +63,20 @@ using namespace Qt::StringLiterals;
namespace QV4 {
-QPair<QObject *, int> QObjectMethod::extractQtMethod(const FunctionObject *function)
+std::pair<QObject *, int> QObjectMethod::extractQtMethod(const FunctionObject *function)
{
ExecutionEngine *v4 = function->engine();
if (v4) {
Scope scope(v4);
Scoped<QObjectMethod> method(scope, function->as<QObjectMethod>());
if (method)
- return qMakePair(method->object(), method->methodIndex());
+ return std::make_pair(method->object(), method->methodIndex());
}
- return qMakePair((QObject *)nullptr, -1);
+ return std::make_pair((QObject *)nullptr, -1);
}
-static QPair<QObject *, int> extractQtSignal(const Value &value)
+static std::pair<QObject *, int> extractQtSignal(const Value &value)
{
if (value.isObject()) {
ExecutionEngine *v4 = value.as<Object>()->engine();
@@ -87,10 +87,10 @@ static QPair<QObject *, int> extractQtSignal(const Value &value)
Scoped<QmlSignalHandler> handler(scope, value);
if (handler)
- return qMakePair(handler->object(), handler->signalIndex());
+ return std::make_pair(handler->object(), handler->signalIndex());
}
- return qMakePair((QObject *)nullptr, -1);
+ return std::make_pair((QObject *)nullptr, -1);
}
static Heap::ReferenceObject::Flags referenceFlags(
@@ -1307,7 +1307,7 @@ struct QObjectSlotDispatcher : public QtPrivate::QSlotObjectBase
(connection->thisObject.isUndefined() || RuntimeHelpers::strictEqual(*connection->thisObject.valueRef(), thisObject))) {
ScopedFunctionObject f(scope, connection->function.value());
- QPair<QObject *, int> connectedFunctionData = QObjectMethod::extractQtMethod(f);
+ std::pair<QObject *, int> connectedFunctionData = QObjectMethod::extractQtMethod(f);
if (connectedFunctionData.first == receiverToDisconnect &&
connectedFunctionData.second == slotIndexToDisconnect) {
*ret = true;
@@ -1340,7 +1340,7 @@ ReturnedValue QObjectWrapper::method_connect(const FunctionObject *b, const Valu
if (argc == 0)
THROW_GENERIC_ERROR("Function.prototype.connect: no arguments given");
- QPair<QObject *, int> signalInfo = extractQtSignal(*thisObject);
+ std::pair<QObject *, int> signalInfo = extractQtSignal(*thisObject);
QObject *signalObject = signalInfo.first;
int signalIndex = signalInfo.second; // in method range, not signal range!
@@ -1382,7 +1382,7 @@ ReturnedValue QObjectWrapper::method_connect(const FunctionObject *b, const Valu
}
}
- QPair<QObject *, int> functionData = QObjectMethod::extractQtMethod(f); // align with disconnect
+ std::pair<QObject *, int> functionData = QObjectMethod::extractQtMethod(f); // align with disconnect
QObject *receiver = nullptr;
if (functionData.first)
@@ -1424,7 +1424,7 @@ ReturnedValue QObjectWrapper::method_disconnect(const FunctionObject *b, const V
if (argc == 0)
THROW_GENERIC_ERROR("Function.prototype.disconnect: no arguments given");
- QPair<QObject *, int> signalInfo = extractQtSignal(*thisObject);
+ std::pair<QObject *, int> signalInfo = extractQtSignal(*thisObject);
QObject *signalObject = signalInfo.first;
int signalIndex = signalInfo.second;
@@ -1453,7 +1453,7 @@ ReturnedValue QObjectWrapper::method_disconnect(const FunctionObject *b, const V
if (!functionThisValue->isUndefined() && !functionThisValue->isObject())
THROW_GENERIC_ERROR("Function.prototype.disconnect: target this is not an object");
- QPair<QObject *, int> functionData = QObjectMethod::extractQtMethod(functionValue);
+ std::pair<QObject *, int> functionData = QObjectMethod::extractQtMethod(functionValue);
void *a[] = {
scope.engine,