From f76c9bf8239c053e5d304664e8b49beab54b9139 Mon Sep 17 00:00:00 2001 From: Dheerendra Purohit Date: Tue, 10 Dec 2024 12:29:41 +0530 Subject: Copy const attribute of method in QMetaObjectBuilder::addMethod() const attribute of prototype object method in QMetaObjectBuilder::addMethod() is not copied. auto test failed due to this missing functionality. Copy const attribute of method in QMetaObjectBuilder::addMethod() from prototype object. Task-number: QTBUG-126849 Change-Id: Iaa4042c2ac50c57eacb6b9821163488d82f7a0be Reviewed-by: Thiago Macieira --- src/corelib/kernel/qmetaobjectbuilder.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/corelib/kernel/qmetaobjectbuilder.cpp') diff --git a/src/corelib/kernel/qmetaobjectbuilder.cpp b/src/corelib/kernel/qmetaobjectbuilder.cpp index b5911aff549..60bcdedba13 100644 --- a/src/corelib/kernel/qmetaobjectbuilder.cpp +++ b/src/corelib/kernel/qmetaobjectbuilder.cpp @@ -433,6 +433,7 @@ QMetaMethodBuilder QMetaObjectBuilder::addMethod(const QMetaMethod &prototype) method.setAccess(prototype.access()); method.setAttributes(prototype.attributes()); method.setRevision(prototype.revision()); + method.setConst(prototype.isConst()); return method; } @@ -1729,7 +1730,7 @@ void QMetaMethodBuilder::setAttributes(int value) /*! Returns true if the method is const qualified. */ -int QMetaMethodBuilder::isConst() const +bool QMetaMethodBuilder::isConst() const { QMetaMethodBuilderPrivate *d = d_func(); if (!d) -- cgit v1.2.3