1
/****************************************************************************
3
** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
4
** Contact: http://www.qt-project.org/legal
6
** This file is part of the documentation of the Qt Toolkit.
8
** $QT_BEGIN_LICENSE:BSD$
9
** You may use this file under the terms of the BSD license as follows:
11
** "Redistribution and use in source and binary forms, with or without
12
** modification, are permitted provided that the following conditions are
14
** * Redistributions of source code must retain the above copyright
15
** notice, this list of conditions and the following disclaimer.
16
** * Redistributions in binary form must reproduce the above copyright
17
** notice, this list of conditions and the following disclaimer in
18
** the documentation and/or other materials provided with the
20
** * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
21
** of its contributors may be used to endorse or promote products derived
22
** from this software without specific prior written permission.
25
** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26
** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27
** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28
** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29
** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30
** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31
** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32
** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33
** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34
** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35
** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
39
****************************************************************************/
46
class MyClass : public QObject
49
Q_CLASSINFO("author", "Sabrina Schweinsteiger")
50
Q_CLASSINFO("url", "http://doc.moosesoft.co.uk/1.0/")
59
QByteArray normType = QMetaObject::normalizedType(" int const *");
60
// normType is now "const int*"
65
QMetaObject::invokeMethod(thread, "quit",
66
Qt::QueuedConnection);
71
QMetaObject::invokeMethod: Unable to handle unregistered datatype 'MyType'
77
QMetaObject::invokeMethod(obj, "compute", Qt::DirectConnection,
78
Q_RETURN_ARG(QString, retVal),
79
Q_ARG(QString, "sqrt"),
89
Q_CLASSINFO("author", "Sabrina Schweinsteiger")
90
Q_CLASSINFO("url", "http://doc.moosesoft.co.uk/1.0/")
99
const QMetaObject* metaObject = obj->metaObject();
100
QStringList properties;
101
for(int i = metaObject->propertyOffset(); i < metaObject->propertyCount(); ++i)
102
properties << QString::fromLatin1(metaObject->property(i).name());
107
const QMetaObject* metaObject = obj->metaObject();
109
for(int i = metaObject->methodOffset(); i < metaObject->methodCount(); ++i)
110
methods << QString::fromLatin1(metaObject->method(i).methodSignature());
114
int methodIndex = pushButton->metaObject()->indexOfMethod("animateClick()");
115
QMetaMethod method = metaObject->method(methodIndex);
116
method.invoke(pushButton, Qt::QueuedConnection);
120
QMetaMethod::invoke: Unable to handle unregistered datatype 'MyType'
125
QByteArray normalizedSignature = QMetaObject::normalizedSignature("compute(QString, int, double)");
126
int methodIndex = obj->metaObject()->indexOfMethod(normalizedSignature);
127
QMetaMethod method = metaObject->method(methodIndex);
129
Qt::DirectConnection,
130
Q_RETURN_ARG(QString, retVal),
131
Q_ARG(QString, "sqrt"),
137
QMetaMethod destroyedSignal = QMetaMethod::fromSignal(&QObject::destroyed);