Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
abstractintrospection.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only WITH Qt-GPL-exception-1.0
3
5
7
8/*!
9 \class QDesignerMetaEnumInterface
10 \internal
11 \since 4.4
12
13 \brief QDesignerMetaEnumInterface is part of \QD's introspection interface and represents an enumeration.
14
15 \inmodule QtDesigner
16
17 The QDesignerMetaEnumInterface class provides meta-data about an enumerator.
18
19 \sa QDesignerMetaObjectInterface
20*/
21
22/*!
23 Constructs a QDesignerMetaEnumInterface object.
24*/
25
26QDesignerMetaEnumInterface::QDesignerMetaEnumInterface() = default;
27
28/*!
29 Destroys the QDesignerMetaEnumInterface object.
30*/
31QDesignerMetaEnumInterface::~QDesignerMetaEnumInterface() = default;
32
33/*!
34 \fn bool QDesignerMetaEnumInterface::isFlag() const
35
36 Returns true if this enumerator is used as a flag.
37*/
38
39/*!
40 \fn QString QDesignerMetaEnumInterface::key(int index) const
41
42 Returns the key with the given \a index.
43*/
44
45/*!
46 \fn int QDesignerMetaEnumInterface::keyCount() const
47
48 Returns the number of keys.
49*/
50
51/*!
52 \fn int QDesignerMetaEnumInterface::keyToValue(const QString &key) const
53
54 Returns the integer value of the given enumeration \a key, or -1 if \a key is not defined.
55*/
56
57/*!
58 \fn int QDesignerMetaEnumInterface::keysToValue(const QString &keys) const
59
60 Returns the value derived from combining together the values of the \a keys using the OR operator, or -1 if keys is not defined. Note that the strings in \a keys must be '|'-separated.
61*/
62
63/*!
64 \fn QString QDesignerMetaEnumInterface::name() const
65
66 Returns the name of the enumerator (without the scope).
67*/
68
69/*!
70 \fn QString QDesignerMetaEnumInterface::scope() const
71
72 Returns the scope this enumerator was declared in.
73*/
74
75/*!
76 \fn QString QDesignerMetaEnumInterface::separator() const
77
78 Returns the separator to be used when building enumeration names.
79*/
80
81/*!
82 \fn int QDesignerMetaEnumInterface::value(int index) const
83
84 Returns the value with the given \a index; or returns -1 if there is no such value.
85*/
86
87/*!
88 \fn QString QDesignerMetaEnumInterface::valueToKey(int value) const
89
90 Returns the string that is used as the name of the given enumeration \a value, or QString::null if value is not defined.
91*/
92
93/*!
94 \fn QString QDesignerMetaEnumInterface::valueToKeys(int value) const
95
96 Returns a byte array of '|'-separated keys that represents the given \a value.
97*/
98
99/*!
100 \class QDesignerMetaPropertyInterface
101 \internal
102 \since 4.4
103
104 \brief QDesignerMetaPropertyInterface is part of \QD's introspection interface and represents a property.
105
106 \inmodule QtDesigner
107
108 The QDesignerMetaPropertyInterface class provides meta-data about a property.
109
110 \sa QDesignerMetaObjectInterface
111*/
112
113/*!
114 Constructs a QDesignerMetaPropertyInterface object.
115*/
116
117QDesignerMetaPropertyInterface::QDesignerMetaPropertyInterface() = default;
118
119/*!
120 Destroys the QDesignerMetaPropertyInterface object.
121*/
122
123QDesignerMetaPropertyInterface::~QDesignerMetaPropertyInterface() = default;
124
125/*!
126 \enum QDesignerMetaPropertyInterface::Kind
127
128 This enum indicates whether the property is of a special type.
129
130 \value EnumKind The property is of an enumeration type
131 \value FlagKind The property is of an flag type
132 \value OtherKind The property is of another type
133 */
134
135/*!
136 \enum QDesignerMetaPropertyInterface::AccessFlag
137
138 These flags specify the access the property provides.
139
140 \value ReadAccess Property can be read
141 \value WriteAccess Property can be written
142 \value ResetAccess Property can be reset to a default value
143 */
144
145/*!
146 \enum QDesignerMetaPropertyInterface::Attribute
147
148 Various attributes of the property.
149
150 \value DesignableAttribute Property is designable (visible in \QD)
151 \value ScriptableAttribute Property is scriptable
152 \value StoredAttribute Property is stored, that is, not calculated
153 \value UserAttribute Property is the property that the user can edit for the QObject
154 */
155
156/*!
157 \fn const QDesignerMetaEnumInterface *QDesignerMetaPropertyInterface::enumerator() const
158
159 Returns the enumerator if this property's type is an enumerator type;
160*/
161
162/*!
163 \fn Kind QDesignerMetaPropertyInterface::kind() const
164
165 Returns the type of the property.
166*/
167
168/*!
169 \fn AccessFlags QDesignerMetaPropertyInterface::accessFlags() const
170
171 Returns a combination of access flags.
172*/
173
174/*!
175 \fn Attributes QDesignerMetaPropertyInterface::attributes() const
176
177 Returns the attributes of the property.
178*/
179
180/*!
181 \fn int QDesignerMetaPropertyInterface::type() const
182
183 Returns the type of the property.
184
185 \sa QMetaType::Type
186*/
187
188/*!
189 \fn QString QDesignerMetaPropertyInterface::name() const
190
191 Returns the name of the property.
192*/
193
194/*!
195 \fn QString QDesignerMetaPropertyInterface::typeName() const
196
197 Returns the name of this property's type.
198*/
199
200
201/*!
202 \fn int QDesignerMetaPropertyInterface::userType() const
203
204 Returns this property's user type.
205*/
206
207/*!
208 \fn bool QDesignerMetaPropertyInterface::hasSetter() const
209
210 Returns whether getter and setter methods exist for this property.
211*/
212
213/*!
214 \fn QVariant QDesignerMetaPropertyInterface::read(const QObject *object) const
215
216 Reads the property's value from the given \a object. Returns the value if it was able to read it; otherwise returns an invalid variant.
217*/
218
219/*!
220 \fn bool QDesignerMetaPropertyInterface::reset(QObject *object) const
221
222 Resets the property for the given \a object with a reset method. Returns true if the reset worked; otherwise returns false.
223*/
224
225/*!
226 \fn bool QDesignerMetaPropertyInterface::write(QObject *object, const QVariant &value) const
227
228 Writes \a value as the property's value to the given \a object. Returns true if the write succeeded; otherwise returns false.
229*/
230
231/*!
232 \class QDesignerMetaMethodInterface
233 \internal
234 \since 4.4
235
236 \brief QDesignerMetaMethodInterface is part of \QD's introspection interface and represents a member function.
237
238 \inmodule QtDesigner
239
240 The QDesignerMetaMethodInterface class provides meta-data about a member function.
241
242 \sa QDesignerMetaObjectInterface
243*/
244
245/*!
246 Constructs a QDesignerMetaMethodInterface object.
247*/
248
249QDesignerMetaMethodInterface::QDesignerMetaMethodInterface() = default;
250
251/*!
252 Destroys the QDesignerMetaMethodInterface object.
253*/
254
255QDesignerMetaMethodInterface::~QDesignerMetaMethodInterface() = default;
256
257/*!
258 \enum QDesignerMetaMethodInterface::MethodType
259
260 This enum specifies the type of the method
261
262 \value Method The function is a plain member function.
263 \value Signal The function is a signal.
264 \value Slot The function is a slot.
265 \value Constructor The function is a constructor.
266
267*/
268
269/*!
270 \enum QDesignerMetaMethodInterface::Access
271
272 This enum represents the access specification of the method
273
274 \value Private A private member function
275 \value Protected A protected member function
276 \value Public A public member function
277*/
278
279/*!
280 \fn QDesignerMetaMethodInterface::Access QDesignerMetaMethodInterface::access() const
281
282 Returns the access specification of this method.
283*/
284
285
286/*!
287 \fn QDesignerMetaMethodInterface::MethodType QDesignerMetaMethodInterface::methodType() const
288
289 Returns the type of this method.
290*/
291
292/*!
293 \fn QStringList QDesignerMetaMethodInterface::parameterNames() const
294
295 Returns a list of parameter names.
296*/
297
298/*!
299 \fn QStringList QDesignerMetaMethodInterface::parameterTypes() const
300
301 Returns a list of parameter types.
302*/
303
304/*!
305 \fn QString QDesignerMetaMethodInterface::signature() const
306
307 Returns the signature of this method.
308*/
309
310/*!
311 \fn QString QDesignerMetaMethodInterface::normalizedSignature() const
312
313 Returns the normalized signature of this method (suitable as signal/slot specification).
314*/
315
316
317/*!
318 \fn QString QDesignerMetaMethodInterface::tag() const
319
320 Returns the tag associated with this method.
321*/
322
323/*!
324 \fn QString QDesignerMetaMethodInterface::typeName() const
325
326 Returns the return type of this method, or an empty string if the return type is void.
327*/
328
329/*!
330 \class QDesignerMetaObjectInterface
331 \internal
332 \since 4.4
333
334 \brief QDesignerMetaObjectInterface is part of \QD's introspection interface and provides meta-information about Qt objects
335
336 \inmodule QtDesigner
337
338 The QDesignerMetaObjectInterface class provides meta-data about Qt objects. For a given object, it can be obtained
339 by querying QDesignerIntrospectionInterface.
340
341 \sa QDesignerIntrospectionInterface
342*/
343
344/*!
345 Constructs a QDesignerMetaObjectInterface object.
346*/
347
348QDesignerMetaObjectInterface::QDesignerMetaObjectInterface() = default;
349
350/*!
351 Destroys the QDesignerMetaObjectInterface object.
352*/
353
354QDesignerMetaObjectInterface::~QDesignerMetaObjectInterface() = default;
355
356/*!
357 \fn QString QDesignerMetaObjectInterface::className() const
358
359 Returns the class name.
360*/
361
362/*!
363 \fn const QDesignerMetaEnumInterface *QDesignerMetaObjectInterface::enumerator(int index) const
364
365 Returns the meta-data for the enumerator with the given \a index.
366*/
367
368/*!
369 \fn int QDesignerMetaObjectInterface::enumeratorCount() const
370
371 Returns the number of enumerators in this class.
372*/
373
374/*!
375 \fn int QDesignerMetaObjectInterface::enumeratorOffset() const
376
377 Returns the enumerator offset for this class; i.e. the index position of this class's first enumerator.
378*/
379
380/*!
381 \fn int QDesignerMetaObjectInterface::indexOfEnumerator(const QString &name) const
382
383 Finds enumerator \a name and returns its index; otherwise returns -1.
384*/
385
386/*!
387 \fn int QDesignerMetaObjectInterface::indexOfMethod(const QString &method) const
388
389 Finds \a method and returns its index; otherwise returns -1.
390*/
391
392/*!
393 \fn int QDesignerMetaObjectInterface::indexOfProperty(const QString &name) const
394
395 Finds property \a name and returns its index; otherwise returns -1.
396*/
397
398/*!
399 \fn int QDesignerMetaObjectInterface::indexOfSignal(const QString &signal) const
400
401 Finds \a signal and returns its index; otherwise returns -1.
402*/
403
404/*!
405 \fn int QDesignerMetaObjectInterface::indexOfSlot(const QString &slot) const
406
407 Finds \a slot and returns its index; otherwise returns -1.
408*/
409
410/*!
411 \fn const QDesignerMetaMethodInterface *QDesignerMetaObjectInterface::method(int index) const
412
413 Returns the meta-data for the method with the given \a index.
414*/
415
416/*!
417 \fn int QDesignerMetaObjectInterface::methodCount() const
418
419 Returns the number of methods in this class. These include ordinary methods, signals, and slots.
420*/
421
422/*!
423 \fn int QDesignerMetaObjectInterface::methodOffset() const
424
425 Returns the method offset for this class; i.e. the index position of this class's first member function.
426*/
427
428/*!
429 \fn const QDesignerMetaPropertyInterface *QDesignerMetaObjectInterface::property(int index) const
430
431 Returns the meta-data for the property with the given \a index.
432*/
433/*!
434 \fn int QDesignerMetaObjectInterface::propertyCount() const
435
436 Returns the number of properties in this class.
437*/
438/*!
439 \fn int QDesignerMetaObjectInterface::propertyOffset() const
440
441 Returns the property offset for this class; i.e. the index position of this class's first property.
442*/
443
444/*!
445 \fn const QDesignerMetaObjectInterface *QDesignerMetaObjectInterface::superClass() const
446
447 Returns the meta-object of the superclass, or 0 if there is no such object.
448*/
449
450/*!
451 \fn const QDesignerMetaPropertyInterface *QDesignerMetaObjectInterface::userProperty() const
452
453 Returns the property that has the USER flag set to true.
454*/
455
456/*!
457 \class QDesignerIntrospectionInterface
458 \internal
459 \since 4.4
460
461 \brief QDesignerIntrospectionInterface provides access to a QDesignerMetaObjectInterface for a given Qt object.
462
463 \inmodule QtDesigner
464
465 QDesignerIntrospectionInterface is the main class of \QD's introspection interface. These
466 interfaces provide a layer of abstraction around QMetaObject and related classes to allow for the integration
467 of other programming languages.
468
469 An instance of QDesignerIntrospectionInterface can be obtained from the core.
470
471 \sa QDesignerMetaObjectInterface
472*/
473
474/*!
475 Constructs a QDesignerIntrospectionInterface object.
476*/
477
478QDesignerIntrospectionInterface::QDesignerIntrospectionInterface()
479{
480}
481
482/*!
483 Destroys the QDesignerIntrospectionInterface object.
484*/
485
486QDesignerIntrospectionInterface::~QDesignerIntrospectionInterface()
487{
488}
489
490/*!
491 \fn const QDesignerMetaObjectInterface* QDesignerIntrospectionInterface::metaObject(const QObject *object) const
492
493 Returns the meta object of this \a object.
494*/
495
496QT_END_NAMESPACE
Combined button and popup list for selecting options.