QMetaMethod and QDBusMetaObject: Give public access to signal methods
To be consistent with signals which are public since Qt5. Change-Id: I633077e37d0851b118c22da0681e8b8b1892ddbb Reviewed-by: Olivier Goffart <ogoffart@woboq.com>bb10
parent
0ec406695e
commit
56bbf3c2d5
|
|
@ -510,7 +510,7 @@ QMetaMethodBuilder QMetaObjectBuilder::addSignal(const QByteArray& signature)
|
|||
{
|
||||
int index = d->methods.size();
|
||||
d->methods.append(QMetaMethodBuilderPrivate
|
||||
(QMetaMethod::Signal, signature, QByteArray("void"), QMetaMethod::Protected));
|
||||
(QMetaMethod::Signal, signature, QByteArray("void"), QMetaMethod::Public));
|
||||
return QMetaMethodBuilder(this, index);
|
||||
}
|
||||
|
||||
|
|
@ -2005,8 +2005,7 @@ void QMetaMethodBuilder::setTag(const QByteArray& value)
|
|||
/*!
|
||||
Returns the access specification of this method (private, protected,
|
||||
or public). The default value is QMetaMethod::Public for methods,
|
||||
slots, and constructors. The default value is QMetaMethod::Protected
|
||||
for signals.
|
||||
slots, signals and constructors.
|
||||
|
||||
\sa setAccess()
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -348,7 +348,7 @@ void QDBusMetaObjectGenerator::parseSignals()
|
|||
prototype.append(')');
|
||||
|
||||
// meta method flags
|
||||
mm.flags = AccessProtected | MethodSignal | MethodScriptable;
|
||||
mm.flags = AccessPublic | MethodSignal | MethodScriptable;
|
||||
|
||||
// add
|
||||
signals_.insert(QMetaObject::normalizedSignature(prototype), mm);
|
||||
|
|
|
|||
|
|
@ -988,7 +988,7 @@ void Moc::parseSignals(ClassDef *def)
|
|||
prev();
|
||||
}
|
||||
FunctionDef funcDef;
|
||||
funcDef.access = FunctionDef::Protected;
|
||||
funcDef.access = FunctionDef::Public;
|
||||
parseFunction(&funcDef);
|
||||
if (funcDef.isVirtual)
|
||||
warning("Signals cannot be declared virtual");
|
||||
|
|
|
|||
|
|
@ -205,7 +205,7 @@ void tst_QMetaMethod::method_data()
|
|||
<< (QList<int>())
|
||||
<< (QList<QByteArray>())
|
||||
<< (QList<QByteArray>())
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("voidInvokable")
|
||||
|
|
@ -241,7 +241,7 @@ void tst_QMetaMethod::method_data()
|
|||
<< QList<int>()
|
||||
<< QList<QByteArray>()
|
||||
<< QList<QByteArray>()
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("voidSignalInt")
|
||||
|
|
@ -250,7 +250,7 @@ void tst_QMetaMethod::method_data()
|
|||
<< (QList<int>() << int(QMetaType::Int))
|
||||
<< (QList<QByteArray>() << QByteArray("int"))
|
||||
<< (QList<QByteArray>() << QByteArray("voidSignalIntArg"))
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("voidInvokableInt")
|
||||
|
|
@ -286,7 +286,7 @@ void tst_QMetaMethod::method_data()
|
|||
<< (QList<int>() << qMetaTypeId<qreal>())
|
||||
<< (QList<QByteArray>() << QByteArray("qreal"))
|
||||
<< (QList<QByteArray>() << QByteArray("voidSignalQRealArg"))
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("voidInvokableQReal")
|
||||
|
|
@ -322,7 +322,7 @@ void tst_QMetaMethod::method_data()
|
|||
<< (QList<int>() << int(QMetaType::QString))
|
||||
<< (QList<QByteArray>() << QByteArray("QString"))
|
||||
<< (QList<QByteArray>() << QByteArray("voidSignalQStringArg"))
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("voidInvokableQString")
|
||||
|
|
@ -358,7 +358,7 @@ void tst_QMetaMethod::method_data()
|
|||
<< (QList<int>() << qMetaTypeId<CustomType>())
|
||||
<< (QList<QByteArray>() << QByteArray("CustomType"))
|
||||
<< (QList<QByteArray>() << QByteArray("voidSignalCustomTypeArg"))
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("voidInvokableCustomType")
|
||||
|
|
@ -394,7 +394,7 @@ void tst_QMetaMethod::method_data()
|
|||
<< (QList<int>() << 0)
|
||||
<< (QList<QByteArray>() << QByteArray("CustomUnregisteredType"))
|
||||
<< (QList<QByteArray>() << QByteArray("voidSignalCustomUnregisteredTypeArg"))
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("voidInvokableCustomUnregisteredType")
|
||||
|
|
@ -430,7 +430,7 @@ void tst_QMetaMethod::method_data()
|
|||
<< (QList<int>())
|
||||
<< (QList<QByteArray>())
|
||||
<< (QList<QByteArray>())
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("boolInvokable")
|
||||
|
|
@ -457,7 +457,7 @@ void tst_QMetaMethod::method_data()
|
|||
<< (QList<int>())
|
||||
<< (QList<QByteArray>())
|
||||
<< (QList<QByteArray>())
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("qrealInvokable")
|
||||
|
|
@ -484,7 +484,7 @@ void tst_QMetaMethod::method_data()
|
|||
<< (QList<int>())
|
||||
<< (QList<QByteArray>())
|
||||
<< (QList<QByteArray>())
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("qstringInvokable")
|
||||
|
|
@ -529,7 +529,7 @@ void tst_QMetaMethod::method_data()
|
|||
"bool,int,uint,qlonglong,qulonglong,double,long,short,char,ulong,ushort,uchar,float)")
|
||||
<< int(QMetaType::QVariant) << QByteArray("QVariant")
|
||||
<< parameterTypes << parameterTypeNames << parameterNames
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("qvariantInvokableBoolIntUIntLonglongULonglongDoubleLongShortCharUlongUshortUcharFloat")
|
||||
|
|
@ -562,7 +562,7 @@ void tst_QMetaMethod::method_data()
|
|||
<< (QList<int>() << int(QMetaType::Bool) << int(QMetaType::Int))
|
||||
<< (QList<QByteArray>() << QByteArray("bool") << QByteArray("int"))
|
||||
<< (QList<QByteArray>() << QByteArray("") << QByteArray(""))
|
||||
<< QMetaMethod::Protected
|
||||
<< QMetaMethod::Public
|
||||
<< QMetaMethod::Signal;
|
||||
|
||||
QTest::newRow("voidInvokableNoParameterNames")
|
||||
|
|
|
|||
|
|
@ -397,7 +397,7 @@ void tst_QMetaObjectBuilder::signal()
|
|||
QCOMPARE(method1.parameterTypes(), QList<QByteArray>() << "QString" << "int");
|
||||
QVERIFY(method1.parameterNames().isEmpty());
|
||||
QVERIFY(method1.tag().isEmpty());
|
||||
QVERIFY(method1.access() == QMetaMethod::Protected);
|
||||
QVERIFY(method1.access() == QMetaMethod::Public);
|
||||
QCOMPARE(method1.attributes(), 0);
|
||||
QCOMPARE(method1.index(), 0);
|
||||
QCOMPARE(builder.methodCount(), 1);
|
||||
|
|
@ -410,7 +410,7 @@ void tst_QMetaObjectBuilder::signal()
|
|||
QCOMPARE(method2.parameterTypes(), QList<QByteArray>() << "QString");
|
||||
QVERIFY(method2.parameterNames().isEmpty());
|
||||
QVERIFY(method2.tag().isEmpty());
|
||||
QVERIFY(method2.access() == QMetaMethod::Protected);
|
||||
QVERIFY(method2.access() == QMetaMethod::Public);
|
||||
QCOMPARE(method2.attributes(), 0);
|
||||
QCOMPARE(method2.index(), 1);
|
||||
QCOMPARE(builder.methodCount(), 2);
|
||||
|
|
|
|||
|
|
@ -2062,7 +2062,7 @@ void tst_QObject::metamethod()
|
|||
m = mobj->method(mobj->indexOfMethod("signal5()"));
|
||||
QVERIFY(m.methodSignature() == "signal5()");
|
||||
QVERIFY(m.methodType() == QMetaMethod::Signal);
|
||||
QVERIFY(m.access() == QMetaMethod::Protected);
|
||||
QVERIFY(m.access() == QMetaMethod::Public);
|
||||
QVERIFY(!(m.attributes() & QMetaMethod::Scriptable));
|
||||
QVERIFY((m.attributes() & QMetaMethod::Compatibility));
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue