MCPcopy Create free account
hub / github.com/KDAB/GammaRay / testRWMetaObject

Method testRWMetaObject

tests/propertyadaptortest.cpp:128–150  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

126 }
127
128 void testRWMetaObject()
129 {
130 QThread obj;
131 auto adaptor = PropertyAdaptorFactory::create(&obj, this);
132 QVERIFY(adaptor);
133
134 QVERIFY(adaptor->count() > 3);
135 verifyPropertyData(adaptor);
136
137 QSignalSpy spy(adaptor, &PropertyAdaptor::propertyChanged);
138 QVERIFY(spy.isValid());
139
140 auto idx = indexOfProperty(adaptor, "priority");
141 QCOMPARE(adaptor->propertyData(idx).accessFlags(), PropertyData::Writable);
142 adaptor->writeProperty(idx, QThread::LowPriority);
143 QCOMPARE(spy.size(), 1);
144 QCOMPARE(spy.at(0).at(0).toInt(), idx);
145 QCOMPARE(spy.at(0).at(1).toInt(), idx);
146 adaptor->writeProperty(idx, QThread::NormalPriority);
147 QCOMPARE(spy.size(), 2);
148 QCOMPARE(spy.at(1).at(0).toInt(), idx);
149 QCOMPARE(spy.at(1).at(1).toInt(), idx);
150 }
151
152 void testSequentialContainer()
153 {

Callers

nothing calls this directly

Calls 6

accessFlagsMethod · 0.80
countMethod · 0.45
isValidMethod · 0.45
propertyDataMethod · 0.45
writePropertyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected