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