18#include <private/qmetaobject_p.h>
19#include <private/qqmlmetaobject_p.h>
20#include <private/qqmltype_p.h>
21#include <private/qtqmlglobal_p.h>
23#include <QtQml/qqml.h>
24#include <QtCore/qobject.h>
30 return v !=
nullptr && qstrcmp(v,
"0") != 0 && qstrcmp(v,
"false") != 0;
33template<
typename T, T(*Convert)(
const char *)>
36 if (Q_UNLIKELY(!qEnvironmentVariableIsEmpty(var)))
37 return Convert(qgetenv(var));
38 return Convert(
nullptr);
41#define DEFINE_BOOL_CONFIG_OPTION(name, var)
44 static const bool result = qmlGetConfigOption<bool, qmlConvertBoolConfigOption>(#var);
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63#define qmlobject_connect(Sender, SenderType, Signal, Receiver, ReceiverType, Method) do
65 SenderType *sender = (Sender);
66 ReceiverType *receiver = (Receiver);
67 const char *signal = (Signal);
68 const char *method = (Method);
69 static int signalIdx = -1
;
70 static int methodIdx = -1
;
72 Q_ASSERT((int(*signal) - '0') == QSIGNAL_CODE);
73 signalIdx = SenderType::staticMetaObject.indexOfSignal(signal+1
);
76 int code = (int(*method) - '0');
77 Q_ASSERT(code == QSLOT_CODE || code == QSIGNAL_CODE);
78 if (code == QSLOT_CODE)
79 methodIdx = ReceiverType::staticMetaObject.indexOfSlot(method+1
);
81 methodIdx = ReceiverType::staticMetaObject.indexOfSignal(method+1
);
83 Q_ASSERT(signalIdx != -1
&& methodIdx != -1
);
84 QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); \
85}while (0)
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102#define qmlobject_disconnect(Sender, SenderType, Signal, Receiver, ReceiverType, Method) do
104 SenderType *sender = (Sender);
105 ReceiverType *receiver = (Receiver);
106 const char *signal = (Signal);
107 const char *method = (Method);
108 static int signalIdx = -1
;
109 static int methodIdx = -1
;
111 Q_ASSERT((int(*signal) - '0') == QSIGNAL_CODE);
112 signalIdx = SenderType::staticMetaObject.indexOfSignal(signal+1
);
115 int code = (int(*method) - '0');
116 Q_ASSERT(code == QSLOT_CODE || code == QSIGNAL_CODE);
117 if (code == QSLOT_CODE)
118 methodIdx = ReceiverType::staticMetaObject.indexOfSlot(method+1
);
120 methodIdx = ReceiverType::staticMetaObject.indexOfSignal(method+1
);
122 Q_ASSERT(signalIdx != -1
&& methodIdx != -1
);
123 QMetaObject::disconnect(sender, signalIdx, receiver, methodIdx); \
124}while (0)
130
131
132
133
134
135
136
137
138
139
140
146 if (qmlobject_can_cpp_cast(object, &(std::remove_pointer_t<T>::staticMetaObject)))
147 return static_cast<T>(object);
154inline QQuickItem *qmlobject_cast<QQuickItem *>(QObject *object)
156 if (!object || !object->isQuickItemType())
160 return reinterpret_cast<QQuickItem *>(object);
163#define IS_SIGNAL_CONNECTED(Sender, SenderType, Name, Arguments) do
165 QObject *sender = (Sender);
166 void (SenderType::*signal)Arguments = &SenderType::Name;
167 static QMetaMethod method = QMetaMethod::fromSignal(signal);
168 static int signalIdx = QMetaObjectPrivate::signalIndex(method);
169 return QObjectPrivate::get(sender)->isSignalConnected(signalIdx); \
170}while (0)
173
174
175
176
179 QObjectPrivate *d_ptr = QObjectPrivate::get(object);
180 bool sce = d_ptr->sendChildEvents;
181 d_ptr->sendChildEvents =
false;
182 object->setParent(parent);
183 d_ptr->sendChildEvents = sce;
190 QMetaType targetMetaType,
void *target,
const QV4::Value &source,
191 QV4::ExecutionEngine *engine);
193 QMetaType targetMetaType,
void *target, QMetaType sourceMetaType,
void *source,
194 QV4::ExecutionEngine *engine);
197 const QQmlType &targetType,
const QV4::Value &source, QV4::ExecutionEngine *engine);
199 QMetaType targetMetaType,
const QMetaObject *targetMetaObject,
200 int ctorIndex,
void **args);
211 virtual ~QQmlColorProvider();
212 virtual QVariant colorFromString(
const QString &,
bool *);
213 virtual unsigned rgbaFromString(
const QString &,
bool *);
215 virtual QVariant fromRgbF(
double,
double,
double,
double);
216 virtual QVariant fromHslF(
double,
double,
double,
double);
217 virtual QVariant fromHsvF(
double,
double,
double,
double);
218 virtual QVariant lighter(
const QVariant &, qreal);
219 virtual QVariant darker(
const QVariant &, qreal);
220 virtual QVariant alpha(
const QVariant &, qreal);
221 virtual QVariant tint(
const QVariant &,
const QVariant &);
227class QQmlApplication;
231 virtual ~QQmlGuiProvider();
232 virtual QQmlApplication *application(QObject *parent);
233 virtual QObject *inputMethod();
234 virtual QObject *styleHints();
235 virtual QStringList fontFamilies();
236 virtual bool openUrlExternally(
const QUrl &);
237 virtual QString pluginName()
const;
249 Q_PROPERTY(QStringList arguments READ args CONSTANT)
250 Q_PROPERTY(QString name READ name WRITE setName NOTIFY nameChanged)
251 Q_PROPERTY(QString version READ version WRITE setVersion NOTIFY versionChanged)
252 Q_PROPERTY(QString organization READ organization WRITE setOrganization NOTIFY organizationChanged)
253 Q_PROPERTY(QString domain READ domain WRITE setDomain NOTIFY domainChanged)
256 QQmlApplication(QObject* parent=
nullptr);
260 QString name()
const;
261 QString version()
const;
262 QString organization()
const;
263 QString domain()
const;
266 void setName(
const QString &arg);
267 void setVersion(
const QString &arg);
268 void setOrganization(
const QString &arg);
269 void setDomain(
const QString &arg);
275 void versionChanged();
276 void organizationChanged();
277 void domainChanged();
280 QQmlApplication(QQmlApplicationPrivate &dd, QObject* parent=
nullptr);
283 Q_DISABLE_COPY(QQmlApplication)
284 Q_DECLARE_PRIVATE(QQmlApplication)
289 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)
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)