21myCustomObject->doSomething();
24QVERIFY(arguments.at(0).typeId() == QMetaType::Int);
25QVERIFY(arguments.at(1).typeId() == QMetaType::QString);
26QVERIFY(arguments.at(2).typeId() == QMetaType::Double);
31qRegisterMetaType<SomeStruct>();
53auto mo = object.metaObject();
54auto signalIndex = mo->indexOfSignal(
"objectNameChanged(QString)");
55auto signal = mo->method(signalIndex);
58object.setObjectName(
"A new object name");
63void tst_QWindow::writeMinMaxDimensionalProps_data()
64 QTest::addColumn<
int>(
"propertyIndex");
67 static const auto mo = QWindow::staticMetaObject;
68 for (
int i = mo.propertyOffset(); i < mo.propertyCount(); ++i) {
69 auto property = mo.property(i);
72 if (property.type() == QVariant::Int) {
73 static const QRegularExpression re(
"^minimum|maximum");
74 const auto name = property.name();
77 if (re.match(name).hasMatch()) {
78 QTest::addRow(
"%s", name) << i;
84void tst_QWindow::writeMinMaxDimensionalProps()
86 QFETCH(
int, propertyIndex);
88 auto property = QWindow::staticMetaObject.property(propertyIndex);
89 QVERIFY(property.isWritable());
90 QVERIFY(property.hasNotifySignal());
93 QSignalSpy spy(&window, property.notifySignal());
95 QVERIFY(property.write(&window, 42));
96 QCOMPARE(spy.count(), 1);
QSignalSpy spy(myCustomObject, SIGNAL(mySignal(int, QString, double)))
[0]
QList< QVariant > arguments