19#include <private/qmetaobject_p.h>
20#include <private/qqmlmetaobject_p.h>
21#include <private/qqmltype_p.h>
22#include <private/qtqmlglobal_p.h>
24#include <QtQml/qqml.h>
25#include <QtCore/qobject.h>
31 return v !=
nullptr && qstrcmp(v,
"0") != 0 && qstrcmp(v,
"false") != 0;
34template<
typename T, T(*Convert)(
const char *)>
37 if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty(var)))
38 return Convert(qgetenv(var));
39 return Convert(
nullptr);
42#define DEFINE_BOOL_CONFIG_OPTION(name, var)
45 static const bool result = qmlGetConfigOption<bool, qmlConvertBoolConfigOption>(#var);
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64#define qmlobject_connect(Sender, SenderType, Signal, Receiver, ReceiverType, Method) do
66 SenderType *sender = (Sender);
67 ReceiverType *receiver = (Receiver);
68 const char *signal = (Signal);
69 const char *method = (Method);
70 static int signalIdx = -1
;
71 static int methodIdx = -1
;
73 Q_ASSERT((int(*signal) - '0') == QSIGNAL_CODE);
74 signalIdx = SenderType::staticMetaObject.indexOfSignal(signal+1
);
77 int code = (int(*method) - '0');
78 Q_ASSERT(code == QSLOT_CODE || code == QSIGNAL_CODE);
79 if (code == QSLOT_CODE)
80 methodIdx = ReceiverType::staticMetaObject.indexOfSlot(method+1
);
82 methodIdx = ReceiverType::staticMetaObject.indexOfSignal(method+1
);
84 Q_ASSERT(signalIdx != -1
&& methodIdx != -1
);
85 QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); \
86}while (0)
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103#define qmlobject_disconnect(Sender, SenderType, Signal, Receiver, ReceiverType, Method) do
105 SenderType *sender = (Sender);
106 ReceiverType *receiver = (Receiver);
107 const char *signal = (Signal);
108 const char *method = (Method);
109 static int signalIdx = -1
;
110 static int methodIdx = -1
;
112 Q_ASSERT((int(*signal) - '0') == QSIGNAL_CODE);
113 signalIdx = SenderType::staticMetaObject.indexOfSignal(signal+1
);
116 int code = (int(*method) - '0');
117 Q_ASSERT(code == QSLOT_CODE || code == QSIGNAL_CODE);
118 if (code == QSLOT_CODE)
119 methodIdx = ReceiverType::staticMetaObject.indexOfSlot(method+1
);
121 methodIdx = ReceiverType::staticMetaObject.indexOfSignal(method+1
);
123 Q_ASSERT(signalIdx != -1
&& methodIdx != -1
);
124 QMetaObject::disconnect(sender, signalIdx, receiver, methodIdx); \
125}while (0)
131
132
133
134
135
136
137
138
139
140
141
147 if (qmlobject_can_cpp_cast(object, &(std::remove_pointer_t<T>::staticMetaObject)))
148 return static_cast<T>(object);
155inline QQuickItem *qmlobject_cast<QQuickItem *>(QObject *object)
157 if (!object || !object->isQuickItemType())
161 return reinterpret_cast<QQuickItem *>(object);
164#define IS_SIGNAL_CONNECTED(Sender, SenderType, Name, Arguments) do
166 QObject *sender = (Sender);
167 void (SenderType::*signal)Arguments = &SenderType::Name;
168 static QMetaMethod method = QMetaMethod::fromSignal(signal);
169 static int signalIdx = QMetaObjectPrivate::signalIndex(method);
170 return QObjectPrivate::get(sender)->isSignalConnected(signalIdx); \
171}while (0)
174
175
176
177
180 QObjectPrivate *d_ptr = QObjectPrivate::get(object);
181 bool sce = d_ptr->sendChildEvents;
182 d_ptr->sendChildEvents =
false;
183 object->setParent(parent);
184 d_ptr->sendChildEvents = sce;
191 QMetaType targetMetaType,
void *target,
const QV4::Value &source,
192 QV4::ExecutionEngine *engine);
194 QMetaType targetMetaType,
void *target, QMetaType sourceMetaType,
void *source,
195 QV4::ExecutionEngine *engine);
198 const QQmlType &targetType,
const QV4::Value &source, QV4::ExecutionEngine *engine);
200 QMetaType targetMetaType,
const QMetaObject *targetMetaObject,
201 int ctorIndex,
void **args);
212 virtual ~QQmlColorProvider();
213 virtual QVariant colorFromString(
const QString &,
bool *);
214 virtual unsigned rgbaFromString(
const QString &,
bool *);
216 virtual QVariant fromRgbF(
double,
double,
double,
double);
217 virtual QVariant fromHslF(
double,
double,
double,
double);
218 virtual QVariant fromHsvF(
double,
double,
double,
double);
219 virtual QVariant lighter(
const QVariant &, qreal);
220 virtual QVariant darker(
const QVariant &, qreal);
221 virtual QVariant alpha(
const QVariant &, qreal);
222 virtual QVariant tint(
const QVariant &,
const QVariant &);
228class QQmlApplication;
232 virtual ~QQmlGuiProvider();
233 virtual QQmlApplication *application(QObject *parent);
234 virtual QObject *inputMethod();
235 virtual QObject *styleHints();
236 virtual QStringList fontFamilies();
237 virtual bool openUrlExternally(
const QUrl &);
238 virtual QString pluginName()
const;
250 Q_PROPERTY(QStringList arguments READ args CONSTANT)
251 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
252 Q_PROPERTY(QString version READ version WRITE setVersion NOTIFY versionChanged)
253 Q_PROPERTY(QString organization READ organization WRITE setOrganization NOTIFY organizationChanged)
254 Q_PROPERTY(QString domain READ domain WRITE setDomain NOTIFY domainChanged)
257 QQmlApplication(QObject* parent=
nullptr);
261 QString name()
const;
262 QString version()
const;
263 QString organization()
const;
264 QString domain()
const;
267 void setName(
const QString &arg);
268 void setVersion(
const QString &arg);
269 void setOrganization(
const QString &arg);
270 void setDomain(
const QString &arg);
276 void versionChanged();
277 void organizationChanged();
278 void domainChanged();
281 QQmlApplication(QQmlApplicationPrivate &dd, QObject* parent=
nullptr);
284 Q_DISABLE_COPY(QQmlApplication)
285 Q_DECLARE_PRIVATE(QQmlApplication)
290 Q_DECLARE_PUBLIC(QQmlApplication)
QQmlPropertyObserver(QQmlBoundSignalExpression *expr)
static bool populateValueType(QMetaType targetMetaType, void *target, const QV4::Value &source, QV4::ExecutionEngine *engine)
static QVariant createValueType(const QV4::Value &, QMetaType, QV4::ExecutionEngine *)
static Q_QML_EXPORT void * heapCreateValueType(const QQmlType &targetType, const QV4::Value &source, QV4::ExecutionEngine *engine)
static bool populateValueType(QMetaType targetMetaType, void *target, QMetaType sourceMetaType, void *source, QV4::ExecutionEngine *engine)
static QVariant constructValueType(QMetaType targetMetaType, const QMetaObject *targetMetaObject, int ctorIndex, void **args)
static QVariant createValueType(const QJSValue &, QMetaType)
Combined button and popup list for selecting options.
void QQmlBoundSignal_callback(QQmlNotifierEndpoint *e, void **a)
void QQml_setParent_noEvent(QObject *object, QObject *parent)
Makes the object a child of parent.
T qmlobject_cast(QObject *object)
This method is identical to qobject_cast<T>() except that it does not require lazy QMetaObjects to be...
T qmlGetConfigOption(const char *var)
Q_QML_EXPORT bool qmlobject_can_cpp_cast(QObject *object, const QMetaObject *mo)
QT_BEGIN_NAMESPACE bool qmlConvertBoolConfigOption(const char *v)
Q_QML_EXPORT bool qmlobject_can_qml_cast(QObject *object, const QQmlType &type)
QQmlSourceLocation(const QString &sourceFile, quint16 line, quint16 column)