Merge lp:~veebers/autopilot-qt/non-visual-components-take2 into lp:autopilot-qt
- non-visual-components-take2
- Merge into trunk
Proposed by
Christopher Lee
Status: | Work in progress |
---|---|
Proposed branch: | lp:~veebers/autopilot-qt/non-visual-components-take2 |
Merge into: | lp:autopilot-qt |
Diff against target: |
381 lines (+138/-50) 7 files modified
driver/dbus_object.cpp (+0/-1) driver/introspection.cpp (+65/-15) driver/introspection.h (+5/-0) driver/qtnode.cpp (+37/-32) driver/qtnode.h (+3/-1) driver/qttestability.cpp (+1/-1) tests/unittests/tst_introspection.cpp (+27/-0) |
To merge this branch: | bzr merge lp:~veebers/autopilot-qt/non-visual-components-take2 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Autopilot Hackers | Pending | ||
Review via email: mp+214143@code.launchpad.net |
Commit message
Re-introduce non-visual introspection of components.
Description of the change
Re-introduce code to introspect non-visual components, the tests and some optimisations too that make it all possible.
To post a comment you must log in.
Unmerged revisions
- 83. By Christopher Lee
-
Re-introduce backed out non-visual code, optimisations and tests.
Preview Diff
[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1 | === modified file 'driver/dbus_object.cpp' | |||
2 | --- driver/dbus_object.cpp 2014-03-12 13:26:27 +0000 | |||
3 | +++ driver/dbus_object.cpp 2014-04-04 01:00:19 +0000 | |||
4 | @@ -303,4 +303,3 @@ | |||
5 | 303 | 303 | ||
6 | 304 | QDBusConnection::sessionBus().send(msg); | 304 | QDBusConnection::sessionBus().send(msg); |
7 | 305 | } | 305 | } |
8 | 306 | |||
9 | 307 | 306 | ||
10 | === modified file 'driver/introspection.cpp' | |||
11 | --- driver/introspection.cpp 2014-03-12 13:26:27 +0000 | |||
12 | +++ driver/introspection.cpp 2014-04-04 01:00:19 +0000 | |||
13 | @@ -46,7 +46,8 @@ | |||
14 | 46 | QVariant IntrospectNode(QObject* obj); | 46 | QVariant IntrospectNode(QObject* obj); |
15 | 47 | QString GetNodeName(QObject* obj); | 47 | QString GetNodeName(QObject* obj); |
16 | 48 | QStringList GetNodeChildNames(QObject* obj); | 48 | QStringList GetNodeChildNames(QObject* obj); |
18 | 49 | void AddCustomProperties(QObject* obj, QVariantMap& properties); | 49 | QVariant GetGlobalRect(QObject* obj); |
19 | 50 | QVariant GetChildrenNames(QObject* obj); | ||
20 | 50 | 51 | ||
21 | 51 | QList<NodeIntrospectionData> Introspect(QString const& query_string) | 52 | QList<NodeIntrospectionData> Introspect(QString const& query_string) |
22 | 52 | { | 53 | { |
23 | @@ -58,7 +59,6 @@ | |||
24 | 58 | } | 59 | } |
25 | 59 | 60 | ||
26 | 60 | return state; | 61 | return state; |
27 | 61 | |||
28 | 62 | } | 62 | } |
29 | 63 | 63 | ||
30 | 64 | 64 | ||
31 | @@ -128,7 +128,7 @@ | |||
32 | 128 | QMetaProperty prop = meta->property(i); | 128 | QMetaProperty prop = meta->property(i); |
33 | 129 | if (!prop.isValid()) | 129 | if (!prop.isValid()) |
34 | 130 | { | 130 | { |
36 | 131 | qDebug() << "Property at index" << i << "Is not valid!"; | 131 | qDebug() << "Property at index" << i << "is not valid!"; |
37 | 132 | continue; | 132 | continue; |
38 | 133 | } | 133 | } |
39 | 134 | QVariant object_property = PackProperty(prop.read(obj)); | 134 | QVariant object_property = PackProperty(prop.read(obj)); |
40 | @@ -150,18 +150,59 @@ | |||
41 | 150 | meta = meta->superClass(); | 150 | meta = meta->superClass(); |
42 | 151 | } while(meta); | 151 | } while(meta); |
43 | 152 | 152 | ||
45 | 153 | AddCustomProperties(obj, object_properties); | 153 | QVariant global_rect_property = GetNodeProperty(obj, "globalRect"); |
46 | 154 | if(global_rect_property.isValid()) | ||
47 | 155 | object_properties["globalRect"] = global_rect_property; | ||
48 | 154 | 156 | ||
49 | 155 | // add the 'Children' pseudo-property: | 157 | // add the 'Children' pseudo-property: |
50 | 158 | QVariant children_property = GetNodeProperty(obj, "Children"); | ||
51 | 159 | if(children_property.isValid()) | ||
52 | 160 | object_properties["Children"] = children_property; | ||
53 | 161 | |||
54 | 162 | return object_properties; | ||
55 | 163 | } | ||
56 | 164 | |||
57 | 165 | QVariant GetNodeProperty(QObject* obj, const std::string& property_name) | ||
58 | 166 | { | ||
59 | 167 | if(property_name == "globalRect") | ||
60 | 168 | return GetGlobalRect(obj); | ||
61 | 169 | |||
62 | 170 | if(property_name == "Children") | ||
63 | 171 | return GetChildrenNames(obj); | ||
64 | 172 | |||
65 | 173 | QVariant dynamic_property = obj->property(property_name.c_str()); | ||
66 | 174 | if (dynamic_property.isValid()) | ||
67 | 175 | { | ||
68 | 176 | return PackProperty(dynamic_property); | ||
69 | 177 | } | ||
70 | 178 | else | ||
71 | 179 | { | ||
72 | 180 | const QMetaObject* meta = obj->metaObject(); | ||
73 | 181 | int property_index = meta->indexOfProperty(property_name.c_str()); | ||
74 | 182 | if(property_index != -1) | ||
75 | 183 | { | ||
76 | 184 | QMetaProperty prop = meta->property(property_index); | ||
77 | 185 | if(prop.isValid()) | ||
78 | 186 | return PackProperty(prop.read(obj)); | ||
79 | 187 | else | ||
80 | 188 | qDebug() << "Property " << QString::fromStdString(property_name) | ||
81 | 189 | << " is not valid."; | ||
82 | 190 | } | ||
83 | 191 | } | ||
84 | 192 | |||
85 | 193 | return QVariant(); | ||
86 | 194 | } | ||
87 | 195 | |||
88 | 196 | QVariant GetChildrenNames(QObject* obj) | ||
89 | 197 | { | ||
90 | 156 | QStringList children = GetNodeChildNames(obj); | 198 | QStringList children = GetNodeChildNames(obj); |
91 | 157 | if (!children.empty()) | 199 | if (!children.empty()) |
95 | 158 | object_properties["Children"] = PackProperty(children); | 200 | return PackProperty(children); |
96 | 159 | 201 | else | |
97 | 160 | return object_properties; | 202 | return QVariant(); |
98 | 161 | } | 203 | } |
99 | 162 | 204 | ||
102 | 163 | 205 | QVariant GetGlobalRect(QObject* obj) | |
101 | 164 | void AddCustomProperties(QObject* obj, QVariantMap &properties) | ||
103 | 165 | { | 206 | { |
104 | 166 | // Add any custom properties we need to the given QObject. | 207 | // Add any custom properties we need to the given QObject. |
105 | 167 | // Add GlobalRect support for QWidget-derived classes | 208 | // Add GlobalRect support for QWidget-derived classes |
106 | @@ -170,7 +211,7 @@ | |||
107 | 170 | { | 211 | { |
108 | 171 | QRect r = w->rect(); | 212 | QRect r = w->rect(); |
109 | 172 | r = QRect(w->mapToGlobal(r.topLeft()), r.size()); | 213 | r = QRect(w->mapToGlobal(r.topLeft()), r.size()); |
111 | 173 | properties["globalRect"] = PackProperty(r); | 214 | return PackProperty(r); |
112 | 174 | } | 215 | } |
113 | 175 | // ...and support for QGraphicsItem-derived classes. | 216 | // ...and support for QGraphicsItem-derived classes. |
114 | 176 | else if (QGraphicsItem *i = qobject_cast<QGraphicsItem*>(obj)) | 217 | else if (QGraphicsItem *i = qobject_cast<QGraphicsItem*>(obj)) |
115 | @@ -184,19 +225,28 @@ | |||
116 | 184 | QRect global_rect = QRect( | 225 | QRect global_rect = QRect( |
117 | 185 | view->mapToGlobal(scene_rect.topLeft()), | 226 | view->mapToGlobal(scene_rect.topLeft()), |
118 | 186 | scene_rect.size()); | 227 | scene_rect.size()); |
120 | 187 | properties["globalRect"] = PackProperty(global_rect); | 228 | return PackProperty(global_rect); |
121 | 188 | } | 229 | } |
122 | 189 | #ifdef QT5_SUPPORT | 230 | #ifdef QT5_SUPPORT |
123 | 190 | // ... and support for QQuickItems (aka. Qt5 Declarative items) | 231 | // ... and support for QQuickItems (aka. Qt5 Declarative items) |
124 | 191 | else if (QQuickItem *i = qobject_cast<QQuickItem*>(obj)) | 232 | else if (QQuickItem *i = qobject_cast<QQuickItem*>(obj)) |
125 | 192 | { | 233 | { |
126 | 193 | QQuickWindow *view = i->window(); | 234 | QQuickWindow *view = i->window(); |
131 | 194 | QRectF bounding_rect = i->boundingRect(); | 235 | if(view) |
132 | 195 | bounding_rect = i->mapRectToScene(bounding_rect); | 236 | { |
133 | 196 | QRect global_rect = QRect(view->mapToGlobal(bounding_rect.toRect().topLeft()), bounding_rect.size().toSize()); | 237 | QRectF bounding_rect = i->boundingRect(); |
134 | 197 | properties["globalRect"] = PackProperty(global_rect); | 238 | bounding_rect = i->mapRectToScene(bounding_rect); |
135 | 239 | QRect global_rect = QRect( | ||
136 | 240 | view->mapToGlobal(bounding_rect.toRect().topLeft()), bounding_rect.size().toSize() | ||
137 | 241 | ); | ||
138 | 242 | |||
139 | 243 | return PackProperty(global_rect); | ||
140 | 244 | } | ||
141 | 198 | } | 245 | } |
142 | 199 | #endif | 246 | #endif |
143 | 247 | |||
144 | 248 | // Default to returning invalid QVariant | ||
145 | 249 | return QVariant(); | ||
146 | 200 | } | 250 | } |
147 | 201 | 251 | ||
148 | 202 | QVariant PackProperty(QVariant const& prop) | 252 | QVariant PackProperty(QVariant const& prop) |
149 | 203 | 253 | ||
150 | === modified file 'driver/introspection.h' | |||
151 | --- driver/introspection.h 2014-03-12 13:26:27 +0000 | |||
152 | +++ driver/introspection.h 2014-04-04 01:00:19 +0000 | |||
153 | @@ -26,5 +26,10 @@ | |||
154 | 26 | /// given QObject. | 26 | /// given QObject. |
155 | 27 | QVariantMap GetNodeProperties(QObject* obj); | 27 | QVariantMap GetNodeProperties(QObject* obj); |
156 | 28 | 28 | ||
157 | 29 | /// Return a QVariant containing the requested property | ||
158 | 30 | /// "property_name" or an invalid QVariant if the property is not | ||
159 | 31 | /// found. | ||
160 | 32 | QVariant GetNodeProperty(QObject* obj, const std::string& property_name); | ||
161 | 33 | |||
162 | 29 | 34 | ||
163 | 30 | #endif | 35 | #endif |
164 | 31 | 36 | ||
165 | === modified file 'driver/qtnode.cpp' | |||
166 | --- driver/qtnode.cpp 2014-03-12 13:26:27 +0000 | |||
167 | +++ driver/qtnode.cpp 2014-04-04 01:00:19 +0000 | |||
168 | @@ -18,22 +18,22 @@ | |||
169 | 18 | #include <QDBusArgument> | 18 | #include <QDBusArgument> |
170 | 19 | 19 | ||
171 | 20 | // Marshall the NodeIntrospectionData data into a D-Bus argument | 20 | // Marshall the NodeIntrospectionData data into a D-Bus argument |
179 | 21 | QDBusArgument &operator<<(QDBusArgument &argument, const NodeIntrospectionData &node_data) | 21 | QDBusArgument &operator<<(QDBusArgument &argument, const NodeIntrospectionData &node_data) |
180 | 22 | { | 22 | { |
181 | 23 | argument.beginStructure(); | 23 | argument.beginStructure(); |
182 | 24 | argument << node_data.object_path << node_data.state; | 24 | argument << node_data.object_path << node_data.state; |
183 | 25 | argument.endStructure(); | 25 | argument.endStructure(); |
184 | 26 | return argument; | 26 | return argument; |
185 | 27 | } | 27 | } |
186 | 28 | 28 | ||
195 | 29 | // Retrieve the NodeIntrospectionData data from the D-Bus argument | 29 | // Retrieve the NodeIntrospectionData data from the D-Bus argument |
196 | 30 | const QDBusArgument &operator>>(const QDBusArgument &argument, NodeIntrospectionData &node_data) | 30 | const QDBusArgument &operator>>(const QDBusArgument &argument, NodeIntrospectionData &node_data) |
197 | 31 | { | 31 | { |
198 | 32 | argument.beginStructure(); | 32 | argument.beginStructure(); |
199 | 33 | argument >> node_data.object_path >> node_data.state; | 33 | argument >> node_data.object_path >> node_data.state; |
200 | 34 | argument.endStructure(); | 34 | argument.endStructure(); |
201 | 35 | return argument; | 35 | return argument; |
202 | 36 | } | 36 | } |
203 | 37 | 37 | ||
204 | 38 | const QByteArray AP_ID_NAME("_autopilot_id"); | 38 | const QByteArray AP_ID_NAME("_autopilot_id"); |
205 | 39 | 39 | ||
206 | @@ -41,6 +41,7 @@ | |||
207 | 41 | : object_(obj) | 41 | : object_(obj) |
208 | 42 | , parent_(parent) | 42 | , parent_(parent) |
209 | 43 | { | 43 | { |
210 | 44 | SetName(obj); | ||
211 | 44 | std::string parent_path = parent ? parent->GetPath() : ""; | 45 | std::string parent_path = parent ? parent->GetPath() : ""; |
212 | 45 | full_path_ = parent_path + "/" + GetName(); | 46 | full_path_ = parent_path + "/" + GetName(); |
213 | 46 | } | 47 | } |
214 | @@ -48,6 +49,7 @@ | |||
215 | 48 | QtNode::QtNode(QObject* obj) | 49 | QtNode::QtNode(QObject* obj) |
216 | 49 | : object_(obj) | 50 | : object_(obj) |
217 | 50 | { | 51 | { |
218 | 52 | SetName(obj); | ||
219 | 51 | full_path_ = "/" + GetName(); | 53 | full_path_ = "/" + GetName(); |
220 | 52 | } | 54 | } |
221 | 53 | 55 | ||
222 | @@ -65,15 +67,18 @@ | |||
223 | 65 | return data; | 67 | return data; |
224 | 66 | } | 68 | } |
225 | 67 | 69 | ||
227 | 68 | std::string QtNode::GetName() const | 70 | void QtNode::SetName(const QObject* object) |
228 | 69 | { | 71 | { |
231 | 70 | QString name = object_->metaObject()->className(); | 72 | QString name = object->metaObject()->className(); |
230 | 71 | |||
232 | 72 | // QML type names get mangled by Qt - they get _QML_N or _QMLTYPE_N appended. | 73 | // QML type names get mangled by Qt - they get _QML_N or _QMLTYPE_N appended. |
233 | 73 | // | ||
234 | 74 | if (name.contains('_')) | 74 | if (name.contains('_')) |
235 | 75 | name = name.split('_').front(); | 75 | name = name.split('_').front(); |
237 | 76 | return name.toStdString(); | 76 | node_name_ = name.toStdString(); |
238 | 77 | } | ||
239 | 78 | |||
240 | 79 | std::string QtNode::GetName() const | ||
241 | 80 | { | ||
242 | 81 | return node_name_; | ||
243 | 77 | } | 82 | } |
244 | 78 | 83 | ||
245 | 79 | std::string QtNode::GetPath() const | 84 | std::string QtNode::GetPath() const |
246 | @@ -99,13 +104,13 @@ | |||
247 | 99 | 104 | ||
248 | 100 | bool QtNode::MatchStringProperty(const std::string& name, const std::string& value) const | 105 | bool QtNode::MatchStringProperty(const std::string& name, const std::string& value) const |
249 | 101 | { | 106 | { |
251 | 102 | QVariantMap properties = GetNodeProperties(object_); | 107 | QVariant property = GetNodeProperty(object_, name); |
252 | 103 | 108 | ||
255 | 104 | QString qname = QString::fromStdString(name); | 109 | if(!property.isValid()) |
254 | 105 | if (! properties.contains(qname)) | ||
256 | 106 | return false; | 110 | return false; |
257 | 107 | 111 | ||
259 | 108 | QVariant object_value = qvariant_cast<QVariantList>(properties[qname]).at(1); | 112 | // Need the value not the object type id |
260 | 113 | QVariant object_value = qvariant_cast<QVariantList>(property).at(1); | ||
261 | 109 | QVariant check_value(QString::fromStdString(value)); | 114 | QVariant check_value(QString::fromStdString(value)); |
262 | 110 | if (check_value.canConvert(object_value.type())) | 115 | if (check_value.canConvert(object_value.type())) |
263 | 111 | { | 116 | { |
264 | @@ -121,13 +126,13 @@ | |||
265 | 121 | if (name == "id") | 126 | if (name == "id") |
266 | 122 | return value == GetId(); | 127 | return value == GetId(); |
267 | 123 | 128 | ||
269 | 124 | QVariantMap properties = GetNodeProperties(object_); | 129 | QVariant property = GetNodeProperty(object_, name); |
270 | 125 | 130 | ||
273 | 126 | QString qname = QString::fromStdString(name); | 131 | if(!property.isValid()) |
272 | 127 | if (! properties.contains(qname)) | ||
274 | 128 | return false; | 132 | return false; |
275 | 129 | 133 | ||
277 | 130 | QVariant object_value = qvariant_cast<QVariantList>(properties[qname]).at(1); | 134 | // Need the value not the object type id |
278 | 135 | QVariant object_value = qvariant_cast<QVariantList>(property).at(1); | ||
279 | 131 | QVariant check_value(value); | 136 | QVariant check_value(value); |
280 | 132 | if (check_value.canConvert(object_value.type())) | 137 | if (check_value.canConvert(object_value.type())) |
281 | 133 | { | 138 | { |
282 | @@ -140,13 +145,13 @@ | |||
283 | 140 | 145 | ||
284 | 141 | bool QtNode::MatchBooleanProperty(const std::string& name, bool value) const | 146 | bool QtNode::MatchBooleanProperty(const std::string& name, bool value) const |
285 | 142 | { | 147 | { |
287 | 143 | QVariantMap properties = GetNodeProperties(object_); | 148 | QVariant property = GetNodeProperty(object_, name); |
288 | 144 | 149 | ||
291 | 145 | QString qname = QString::fromStdString(name); | 150 | if(!property.isValid()) |
290 | 146 | if (! properties.contains(qname)) | ||
292 | 147 | return false; | 151 | return false; |
293 | 148 | 152 | ||
295 | 149 | QVariant object_value = qvariant_cast<QVariantList>(properties[qname]).at(1); | 153 | // Need the value not the object type id |
296 | 154 | QVariant object_value = qvariant_cast<QVariantList>(property).at(1); | ||
297 | 150 | QVariant check_value(value); | 155 | QVariant check_value(value); |
298 | 151 | 156 | ||
299 | 152 | if (check_value.canConvert(object_value.type())) | 157 | if (check_value.canConvert(object_value.type())) |
300 | 153 | 158 | ||
301 | === modified file 'driver/qtnode.h' | |||
302 | --- driver/qtnode.h 2014-03-12 13:26:27 +0000 | |||
303 | +++ driver/qtnode.h 2014-04-04 01:00:19 +0000 | |||
304 | @@ -37,7 +37,6 @@ | |||
305 | 37 | 37 | ||
306 | 38 | virtual NodeIntrospectionData GetIntrospectionData() const; | 38 | virtual NodeIntrospectionData GetIntrospectionData() const; |
307 | 39 | 39 | ||
308 | 40 | |||
309 | 41 | virtual std::string GetName() const; | 40 | virtual std::string GetName() const; |
310 | 42 | virtual std::string GetPath() const; | 41 | virtual std::string GetPath() const; |
311 | 43 | virtual int32_t GetId() const; | 42 | virtual int32_t GetId() const; |
312 | @@ -46,8 +45,11 @@ | |||
313 | 46 | virtual bool MatchBooleanProperty(const std::string& name, bool value) const; | 45 | virtual bool MatchBooleanProperty(const std::string& name, bool value) const; |
314 | 47 | virtual xpathselect::NodeVector Children() const; | 46 | virtual xpathselect::NodeVector Children() const; |
315 | 48 | private: | 47 | private: |
316 | 48 | void SetName(const QObject* object); | ||
317 | 49 | |||
318 | 49 | QObject *object_; | 50 | QObject *object_; |
319 | 50 | std::string full_path_; | 51 | std::string full_path_; |
320 | 52 | std::string node_name_; | ||
321 | 51 | Ptr parent_; | 53 | Ptr parent_; |
322 | 52 | }; | 54 | }; |
323 | 53 | 55 | ||
324 | 54 | 56 | ||
325 | === modified file 'driver/qttestability.cpp' | |||
326 | --- driver/qttestability.cpp 2014-02-21 00:41:07 +0000 | |||
327 | +++ driver/qttestability.cpp 2014-04-04 01:00:19 +0000 | |||
328 | @@ -23,7 +23,7 @@ | |||
329 | 23 | qDebug().nospace() | 23 | qDebug().nospace() |
330 | 24 | << "Testability driver loaded. Wire protocol version is " | 24 | << "Testability driver loaded. Wire protocol version is " |
331 | 25 | << AutopilotAdaptor::WIRE_PROTO_VERSION | 25 | << AutopilotAdaptor::WIRE_PROTO_VERSION |
333 | 26 | << "."; | 26 | << ".(non-visual)"; |
334 | 27 | qDBusRegisterMetaType<NodeIntrospectionData>(); | 27 | qDBusRegisterMetaType<NodeIntrospectionData>(); |
335 | 28 | qDBusRegisterMetaType<QList<NodeIntrospectionData> >(); | 28 | qDBusRegisterMetaType<QList<NodeIntrospectionData> >(); |
336 | 29 | 29 | ||
337 | 30 | 30 | ||
338 | === modified file 'tests/unittests/tst_introspection.cpp' | |||
339 | --- tests/unittests/tst_introspection.cpp 2014-03-12 13:26:27 +0000 | |||
340 | +++ tests/unittests/tst_introspection.cpp 2014-04-04 01:00:19 +0000 | |||
341 | @@ -49,6 +49,8 @@ | |||
342 | 49 | 49 | ||
343 | 50 | void test_property_matching(); | 50 | void test_property_matching(); |
344 | 51 | 51 | ||
345 | 52 | void test_get_node_property(); | ||
346 | 53 | |||
347 | 52 | private: | 54 | private: |
348 | 53 | QMainWindow *m_object; | 55 | QMainWindow *m_object; |
349 | 54 | }; | 56 | }; |
350 | @@ -511,6 +513,31 @@ | |||
351 | 511 | QVERIFY(n.MatchBooleanProperty("visible", true) == true); | 513 | QVERIFY(n.MatchBooleanProperty("visible", true) == true); |
352 | 512 | } | 514 | } |
353 | 513 | 515 | ||
354 | 516 | void tst_Introspection::test_get_node_property() | ||
355 | 517 | { | ||
356 | 518 | QVariant property; | ||
357 | 519 | QVariant unpacked_property; | ||
358 | 520 | |||
359 | 521 | property = GetNodeProperty(m_object, "dynamicTestProperty"); | ||
360 | 522 | unpacked_property = qvariant_cast<QVariantList>(property).at(1); | ||
361 | 523 | QVERIFY(property.isValid() == true); | ||
362 | 524 | QVERIFY(unpacked_property.isValid() == true); | ||
363 | 525 | QVERIFY(unpacked_property.toString() == "testValue"); | ||
364 | 526 | |||
365 | 527 | property = GetNodeProperty(m_object, "myUInt"); | ||
366 | 528 | unpacked_property = qvariant_cast<QVariantList>(property).at(1); | ||
367 | 529 | QVERIFY(property.isValid() == true); | ||
368 | 530 | QVERIFY(unpacked_property.isValid() == true); | ||
369 | 531 | QVERIFY(unpacked_property.toFloat() == 5); | ||
370 | 532 | |||
371 | 533 | // Meta Property | ||
372 | 534 | property = GetNodeProperty(m_object, "fullScreen"); | ||
373 | 535 | unpacked_property = qvariant_cast<QVariantList>(property).at(1); | ||
374 | 536 | QVERIFY(property.isValid() == true); | ||
375 | 537 | QVERIFY(unpacked_property.isValid() == true); | ||
376 | 538 | QVERIFY(unpacked_property.toBool() == false); | ||
377 | 539 | } | ||
378 | 540 | |||
379 | 514 | QTEST_MAIN(tst_Introspection) | 541 | QTEST_MAIN(tst_Introspection) |
380 | 515 | 542 | ||
381 | 516 | #include "tst_introspection.moc" | 543 | #include "tst_introspection.moc" |