| 1 | /****************************************************************************
|
|---|
| 2 | **
|
|---|
| 3 | ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|---|
| 4 | ** Contact: Qt Software Information ([email protected])
|
|---|
| 5 | **
|
|---|
| 6 | ** This file is part of the Qt Designer of the Qt Toolkit.
|
|---|
| 7 | **
|
|---|
| 8 | ** $QT_BEGIN_LICENSE:LGPL$
|
|---|
| 9 | ** Commercial Usage
|
|---|
| 10 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
|---|
| 11 | ** accordance with the Qt Commercial License Agreement provided with the
|
|---|
| 12 | ** Software or, alternatively, in accordance with the terms contained in
|
|---|
| 13 | ** a written agreement between you and Nokia.
|
|---|
| 14 | **
|
|---|
| 15 | ** GNU Lesser General Public License Usage
|
|---|
| 16 | ** Alternatively, this file may be used under the terms of the GNU Lesser
|
|---|
| 17 | ** General Public License version 2.1 as published by the Free Software
|
|---|
| 18 | ** Foundation and appearing in the file LICENSE.LGPL included in the
|
|---|
| 19 | ** packaging of this file. Please review the following information to
|
|---|
| 20 | ** ensure the GNU Lesser General Public License version 2.1 requirements
|
|---|
| 21 | ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|---|
| 22 | **
|
|---|
| 23 | ** In addition, as a special exception, Nokia gives you certain
|
|---|
| 24 | ** additional rights. These rights are described in the Nokia Qt LGPL
|
|---|
| 25 | ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this
|
|---|
| 26 | ** package.
|
|---|
| 27 | **
|
|---|
| 28 | ** GNU General Public License Usage
|
|---|
| 29 | ** Alternatively, this file may be used under the terms of the GNU
|
|---|
| 30 | ** General Public License version 3.0 as published by the Free Software
|
|---|
| 31 | ** Foundation and appearing in the file LICENSE.GPL included in the
|
|---|
| 32 | ** packaging of this file. Please review the following information to
|
|---|
| 33 | ** ensure the GNU General Public License version 3.0 requirements will be
|
|---|
| 34 | ** met: http://www.gnu.org/copyleft/gpl.html.
|
|---|
| 35 | **
|
|---|
| 36 | ** If you are unsure which license is appropriate for your use, please
|
|---|
| 37 | ** contact the sales department at [email protected].
|
|---|
| 38 | ** $QT_END_LICENSE$
|
|---|
| 39 | **
|
|---|
| 40 | ****************************************************************************/
|
|---|
| 41 |
|
|---|
| 42 | #include "abstractintrospection_p.h"
|
|---|
| 43 |
|
|---|
| 44 | QT_BEGIN_NAMESPACE
|
|---|
| 45 |
|
|---|
| 46 | /*!
|
|---|
| 47 | \class QDesignerMetaEnumInterface
|
|---|
| 48 | \internal
|
|---|
| 49 | \since 4.4
|
|---|
| 50 |
|
|---|
| 51 | \brief QDesignerMetaEnumInterface is part of \QD's introspection interface and represents an enumeration.
|
|---|
| 52 |
|
|---|
| 53 | \inmodule QtDesigner
|
|---|
| 54 |
|
|---|
| 55 | The QDesignerMetaEnumInterface class provides meta-data about an enumerator.
|
|---|
| 56 |
|
|---|
| 57 | \sa QDesignerMetaObjectInterface
|
|---|
| 58 | */
|
|---|
| 59 |
|
|---|
| 60 | /*!
|
|---|
| 61 | Constructs a QDesignerMetaEnumInterface object.
|
|---|
| 62 | */
|
|---|
| 63 |
|
|---|
| 64 | QDesignerMetaEnumInterface::QDesignerMetaEnumInterface()
|
|---|
| 65 | {
|
|---|
| 66 | }
|
|---|
| 67 |
|
|---|
| 68 | /*!
|
|---|
| 69 | Destroys the QDesignerMetaEnumInterface object.
|
|---|
| 70 | */
|
|---|
| 71 | QDesignerMetaEnumInterface::~QDesignerMetaEnumInterface()
|
|---|
| 72 | {
|
|---|
| 73 | }
|
|---|
| 74 |
|
|---|
| 75 | /*!
|
|---|
| 76 | \fn bool QDesignerMetaEnumInterface::isFlag() const
|
|---|
| 77 |
|
|---|
| 78 | Returns true if this enumerator is used as a flag.
|
|---|
| 79 | */
|
|---|
| 80 |
|
|---|
| 81 | /*!
|
|---|
| 82 | \fn QString QDesignerMetaEnumInterface::key(int index) const
|
|---|
| 83 |
|
|---|
| 84 | Returns the key with the given \a index.
|
|---|
| 85 | */
|
|---|
| 86 |
|
|---|
| 87 | /*!
|
|---|
| 88 | \fn int QDesignerMetaEnumInterface::keyCount() const
|
|---|
| 89 |
|
|---|
| 90 | Returns the number of keys.
|
|---|
| 91 | */
|
|---|
| 92 |
|
|---|
| 93 | /*!
|
|---|
| 94 | \fn int QDesignerMetaEnumInterface::keyToValue(const QString &key) const
|
|---|
| 95 |
|
|---|
| 96 | Returns the integer value of the given enumeration \a key, or -1 if \a key is not defined.
|
|---|
| 97 | */
|
|---|
| 98 |
|
|---|
| 99 | /*!
|
|---|
| 100 | \fn int QDesignerMetaEnumInterface::keysToValue(const QString &keys) const
|
|---|
| 101 |
|
|---|
| 102 | 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.
|
|---|
| 103 | */
|
|---|
| 104 |
|
|---|
| 105 | /*!
|
|---|
| 106 | \fn QString QDesignerMetaEnumInterface::name() const
|
|---|
| 107 |
|
|---|
| 108 | Returns the name of the enumerator (without the scope).
|
|---|
| 109 | */
|
|---|
| 110 |
|
|---|
| 111 | /*!
|
|---|
| 112 | \fn QString QDesignerMetaEnumInterface::scope() const
|
|---|
| 113 |
|
|---|
| 114 | Returns the scope this enumerator was declared in.
|
|---|
| 115 | */
|
|---|
| 116 |
|
|---|
| 117 | /*!
|
|---|
| 118 | \fn QString QDesignerMetaEnumInterface::separator() const
|
|---|
| 119 |
|
|---|
| 120 | Returns the separator to be used when building enumeration names.
|
|---|
| 121 | */
|
|---|
| 122 |
|
|---|
| 123 | /*!
|
|---|
| 124 | \fn int QDesignerMetaEnumInterface::value(int index) const
|
|---|
| 125 |
|
|---|
| 126 | Returns the value with the given \a index; or returns -1 if there is no such value.
|
|---|
| 127 | */
|
|---|
| 128 |
|
|---|
| 129 | /*!
|
|---|
| 130 | \fn QString QDesignerMetaEnumInterface::valueToKey(int value) const
|
|---|
| 131 |
|
|---|
| 132 | Returns the string that is used as the name of the given enumeration \a value, or QString::null if value is not defined.
|
|---|
| 133 | */
|
|---|
| 134 |
|
|---|
| 135 | /*!
|
|---|
| 136 | \fn QString QDesignerMetaEnumInterface::valueToKeys(int value) const
|
|---|
| 137 |
|
|---|
| 138 | Returns a byte array of '|'-separated keys that represents the given \a value.
|
|---|
| 139 | */
|
|---|
| 140 |
|
|---|
| 141 | /*!
|
|---|
| 142 | \class QDesignerMetaPropertyInterface
|
|---|
| 143 | \internal
|
|---|
| 144 | \since 4.4
|
|---|
| 145 |
|
|---|
| 146 | \brief QDesignerMetaPropertyInterface is part of \QD's introspection interface and represents a property.
|
|---|
| 147 |
|
|---|
| 148 | \inmodule QtDesigner
|
|---|
| 149 |
|
|---|
| 150 | The QDesignerMetaPropertyInterface class provides meta-data about a property.
|
|---|
| 151 |
|
|---|
| 152 | \sa QDesignerMetaObjectInterface
|
|---|
| 153 | */
|
|---|
| 154 |
|
|---|
| 155 | /*!
|
|---|
| 156 | Constructs a QDesignerMetaPropertyInterface object.
|
|---|
| 157 | */
|
|---|
| 158 |
|
|---|
| 159 | QDesignerMetaPropertyInterface::QDesignerMetaPropertyInterface()
|
|---|
| 160 | {
|
|---|
| 161 | }
|
|---|
| 162 |
|
|---|
| 163 | /*!
|
|---|
| 164 | Destroys the QDesignerMetaPropertyInterface object.
|
|---|
| 165 | */
|
|---|
| 166 |
|
|---|
| 167 | QDesignerMetaPropertyInterface::~QDesignerMetaPropertyInterface()
|
|---|
| 168 | {
|
|---|
| 169 | }
|
|---|
| 170 |
|
|---|
| 171 | /*!
|
|---|
| 172 | \enum QDesignerMetaPropertyInterface::Kind
|
|---|
| 173 |
|
|---|
| 174 | This enum indicates whether the property is of a special type.
|
|---|
| 175 |
|
|---|
| 176 | \value EnumKind The property is of an enumeration type
|
|---|
| 177 | \value FlagKind The property is of an flag type
|
|---|
| 178 | \value OtherKind The property is of another type
|
|---|
| 179 | */
|
|---|
| 180 |
|
|---|
| 181 | /*!
|
|---|
| 182 | \enum QDesignerMetaPropertyInterface::AccessFlag
|
|---|
| 183 |
|
|---|
| 184 | These flags specify the access the property provides.
|
|---|
| 185 |
|
|---|
| 186 | \value ReadAccess Property can be read
|
|---|
| 187 | \value WriteAccess Property can be written
|
|---|
| 188 | \value ResetAccess Property can be reset to a default value
|
|---|
| 189 | */
|
|---|
| 190 |
|
|---|
| 191 | /*!
|
|---|
| 192 | \enum QDesignerMetaPropertyInterface::Attribute
|
|---|
| 193 |
|
|---|
| 194 | Various attributes of the property.
|
|---|
| 195 |
|
|---|
| 196 | \value DesignableAttribute Property is designable (visible in \QD)
|
|---|
| 197 | \value ScriptableAttribute Property is scriptable
|
|---|
| 198 | \value StoredAttribute Property is stored, that is, not calculated
|
|---|
| 199 | \value UserAttribute Property is the property that the user can edit for the QObject
|
|---|
| 200 | */
|
|---|
| 201 |
|
|---|
| 202 | /*!
|
|---|
| 203 | \fn const QDesignerMetaEnumInterface *QDesignerMetaPropertyInterface::enumerator() const
|
|---|
| 204 |
|
|---|
| 205 | Returns the enumerator if this property's type is an enumerator type;
|
|---|
| 206 | */
|
|---|
| 207 |
|
|---|
| 208 | /*!
|
|---|
| 209 | \fn Kind QDesignerMetaPropertyInterface::kind() const
|
|---|
| 210 |
|
|---|
| 211 | Returns the type of the property.
|
|---|
| 212 | */
|
|---|
| 213 |
|
|---|
| 214 | /*!
|
|---|
| 215 | \fn AccessFlags QDesignerMetaPropertyInterface::accessFlags() const
|
|---|
| 216 |
|
|---|
| 217 | Returns a combination of access flags.
|
|---|
| 218 | */
|
|---|
| 219 |
|
|---|
| 220 | /*!
|
|---|
| 221 | \fn Attributes QDesignerMetaPropertyInterface::attributes(const QObject *object) const
|
|---|
| 222 |
|
|---|
| 223 | Returns the attributes of the property for the gives \a object.
|
|---|
| 224 | */
|
|---|
| 225 |
|
|---|
| 226 | /*!
|
|---|
| 227 | \fn QVariant::Type QDesignerMetaPropertyInterface::type() const
|
|---|
| 228 |
|
|---|
| 229 | Returns the type of the property.
|
|---|
| 230 | */
|
|---|
| 231 |
|
|---|
| 232 | /*!
|
|---|
| 233 | \fn QString QDesignerMetaPropertyInterface::name() const
|
|---|
| 234 |
|
|---|
| 235 | Returns the name of the property.
|
|---|
| 236 | */
|
|---|
| 237 |
|
|---|
| 238 | /*!
|
|---|
| 239 | \fn QString QDesignerMetaPropertyInterface::typeName() const
|
|---|
| 240 |
|
|---|
| 241 | Returns the name of this property's type.
|
|---|
| 242 | */
|
|---|
| 243 |
|
|---|
| 244 |
|
|---|
| 245 | /*!
|
|---|
| 246 | \fn int QDesignerMetaPropertyInterface::userType() const
|
|---|
| 247 |
|
|---|
| 248 | Returns this property's user type.
|
|---|
| 249 | */
|
|---|
| 250 |
|
|---|
| 251 | /*!
|
|---|
| 252 | \fn bool QDesignerMetaPropertyInterface::hasSetter() const
|
|---|
| 253 |
|
|---|
| 254 | Returns whether getter and setter methods exist for this property.
|
|---|
| 255 | */
|
|---|
| 256 |
|
|---|
| 257 | /*!
|
|---|
| 258 | \fn QVariant QDesignerMetaPropertyInterface::read(const QObject *object) const
|
|---|
| 259 |
|
|---|
| 260 | 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.
|
|---|
| 261 | */
|
|---|
| 262 |
|
|---|
| 263 | /*!
|
|---|
| 264 | \fn bool QDesignerMetaPropertyInterface::reset(QObject *object) const
|
|---|
| 265 |
|
|---|
| 266 | Resets the property for the given \a object with a reset method. Returns true if the reset worked; otherwise returns false.
|
|---|
| 267 | */
|
|---|
| 268 |
|
|---|
| 269 | /*!
|
|---|
| 270 | \fn bool QDesignerMetaPropertyInterface::write(QObject *object, const QVariant &value) const
|
|---|
| 271 |
|
|---|
| 272 | Writes \a value as the property's value to the given \a object. Returns true if the write succeeded; otherwise returns false.
|
|---|
| 273 | */
|
|---|
| 274 |
|
|---|
| 275 | /*!
|
|---|
| 276 | \class QDesignerMetaMethodInterface
|
|---|
| 277 | \internal
|
|---|
| 278 | \since 4.4
|
|---|
| 279 |
|
|---|
| 280 | \brief QDesignerMetaMethodInterface is part of \QD's introspection interface and represents a member function.
|
|---|
| 281 |
|
|---|
| 282 | \inmodule QtDesigner
|
|---|
| 283 |
|
|---|
| 284 | The QDesignerMetaMethodInterface class provides meta-data about a member function.
|
|---|
| 285 |
|
|---|
| 286 | \sa QDesignerMetaObjectInterface
|
|---|
| 287 | */
|
|---|
| 288 |
|
|---|
| 289 | /*!
|
|---|
| 290 | Constructs a QDesignerMetaMethodInterface object.
|
|---|
| 291 | */
|
|---|
| 292 |
|
|---|
| 293 | QDesignerMetaMethodInterface::QDesignerMetaMethodInterface()
|
|---|
| 294 | {
|
|---|
| 295 | }
|
|---|
| 296 |
|
|---|
| 297 | /*!
|
|---|
| 298 | Destroys the QDesignerMetaMethodInterface object.
|
|---|
| 299 | */
|
|---|
| 300 |
|
|---|
| 301 | QDesignerMetaMethodInterface::~QDesignerMetaMethodInterface()
|
|---|
| 302 | {
|
|---|
| 303 | }
|
|---|
| 304 |
|
|---|
| 305 | /*!
|
|---|
| 306 | \enum QDesignerMetaMethodInterface::MethodType
|
|---|
| 307 |
|
|---|
| 308 | This enum specifies the type of the method
|
|---|
| 309 |
|
|---|
| 310 | \value Method The function is a plain member function.
|
|---|
| 311 | \value Signal The function is a signal.
|
|---|
| 312 | \value Slot The function is a slot.
|
|---|
| 313 | \value Constructor The function is a constructor.
|
|---|
| 314 |
|
|---|
| 315 | */
|
|---|
| 316 |
|
|---|
| 317 | /*!
|
|---|
| 318 | \enum QDesignerMetaMethodInterface::Access
|
|---|
| 319 |
|
|---|
| 320 | This enum represents the access specification of the method
|
|---|
| 321 |
|
|---|
| 322 | \value Private A private member function
|
|---|
| 323 | \value Protected A protected member function
|
|---|
| 324 | \value Public A public member function
|
|---|
| 325 | */
|
|---|
| 326 |
|
|---|
| 327 | /*!
|
|---|
| 328 | \fn QDesignerMetaMethodInterface::Access QDesignerMetaMethodInterface::access() const
|
|---|
| 329 |
|
|---|
| 330 | Returns the access specification of this method.
|
|---|
| 331 | */
|
|---|
| 332 |
|
|---|
| 333 |
|
|---|
| 334 | /*!
|
|---|
| 335 | \fn QDesignerMetaMethodInterface::MethodType QDesignerMetaMethodInterface::methodType() const
|
|---|
| 336 |
|
|---|
| 337 | Returns the type of this method.
|
|---|
| 338 | */
|
|---|
| 339 |
|
|---|
| 340 | /*!
|
|---|
| 341 | \fn QStringList QDesignerMetaMethodInterface::parameterNames() const
|
|---|
| 342 |
|
|---|
| 343 | Returns a list of parameter names.
|
|---|
| 344 | */
|
|---|
| 345 |
|
|---|
| 346 | /*!
|
|---|
| 347 | \fn QStringList QDesignerMetaMethodInterface::parameterTypes() const
|
|---|
| 348 |
|
|---|
| 349 | Returns a list of parameter types.
|
|---|
| 350 | */
|
|---|
| 351 |
|
|---|
| 352 | /*!
|
|---|
| 353 | \fn QString QDesignerMetaMethodInterface::signature() const
|
|---|
| 354 |
|
|---|
| 355 | Returns the signature of this method.
|
|---|
| 356 | */
|
|---|
| 357 |
|
|---|
| 358 | /*!
|
|---|
| 359 | \fn QString QDesignerMetaMethodInterface::normalizedSignature() const
|
|---|
| 360 |
|
|---|
| 361 | Returns the normalized signature of this method (suitable as signal/slot specification).
|
|---|
| 362 | */
|
|---|
| 363 |
|
|---|
| 364 |
|
|---|
| 365 | /*!
|
|---|
| 366 | \fn QString QDesignerMetaMethodInterface::tag() const
|
|---|
| 367 |
|
|---|
| 368 | Returns the tag associated with this method.
|
|---|
| 369 | */
|
|---|
| 370 |
|
|---|
| 371 | /*!
|
|---|
| 372 | \fn QString QDesignerMetaMethodInterface::typeName() const
|
|---|
| 373 |
|
|---|
| 374 | Returns the return type of this method, or an empty string if the return type is void.
|
|---|
| 375 | */
|
|---|
| 376 |
|
|---|
| 377 | /*!
|
|---|
| 378 | \class QDesignerMetaObjectInterface
|
|---|
| 379 | \internal
|
|---|
| 380 | \since 4.4
|
|---|
| 381 |
|
|---|
| 382 | \brief QDesignerMetaObjectInterface is part of \QD's introspection interface and provides meta-information about Qt objects
|
|---|
| 383 |
|
|---|
| 384 | \inmodule QtDesigner
|
|---|
| 385 |
|
|---|
| 386 | The QDesignerMetaObjectInterface class provides meta-data about Qt objects. For a given object, it can be obtained
|
|---|
| 387 | by querying QDesignerIntrospectionInterface.
|
|---|
| 388 |
|
|---|
| 389 | \sa QDesignerIntrospectionInterface
|
|---|
| 390 | */
|
|---|
| 391 |
|
|---|
| 392 | /*!
|
|---|
| 393 | Constructs a QDesignerMetaObjectInterface object.
|
|---|
| 394 | */
|
|---|
| 395 |
|
|---|
| 396 | QDesignerMetaObjectInterface::QDesignerMetaObjectInterface()
|
|---|
| 397 | {
|
|---|
| 398 | }
|
|---|
| 399 |
|
|---|
| 400 | /*!
|
|---|
| 401 | Destroys the QDesignerMetaObjectInterface object.
|
|---|
| 402 | */
|
|---|
| 403 |
|
|---|
| 404 | QDesignerMetaObjectInterface::~QDesignerMetaObjectInterface()
|
|---|
| 405 | {
|
|---|
| 406 | }
|
|---|
| 407 |
|
|---|
| 408 | /*!
|
|---|
| 409 | \fn QString QDesignerMetaObjectInterface::className() const
|
|---|
| 410 |
|
|---|
| 411 | Returns the class name.
|
|---|
| 412 | */
|
|---|
| 413 |
|
|---|
| 414 | /*!
|
|---|
| 415 | \fn const QDesignerMetaEnumInterface *QDesignerMetaObjectInterface::enumerator(int index) const
|
|---|
| 416 |
|
|---|
| 417 | Returns the meta-data for the enumerator with the given \a index.
|
|---|
| 418 | */
|
|---|
| 419 |
|
|---|
|
|---|