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
qqmlglobal_p.h File Reference

(05b783617ff897c5c7b94bd9df19d0ff26c20396)

#include <private/qmetaobject_p.h>
#include <private/qqmlmetaobject_p.h>
#include <private/qqmltype_p.h>
#include <private/qtqmlglobal_p.h>
#include <QtQml/qqml.h>
#include <QtCore/qobject.h>
+ Include dependency graph for qqmlglobal_p.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

class  QQmlValueTypeProvider
 
class  QQmlColorProvider
 
class  QQmlGuiProvider
 
class  QQmlApplication
 
class  QQmlApplicationPrivate
 
struct  QQmlSourceLocation
 

Macros

#define DEFINE_BOOL_CONFIG_OPTION(name, var)
 
#define qmlobject_connect(Sender, SenderType, Signal, Receiver, ReceiverType, Method)
 Connect Signal of Sender to Method of Receiver.
 
#define qmlobject_disconnect(Sender, SenderType, Signal, Receiver, ReceiverType, Method)
 Disconnect Signal of Sender from Method of Receiver.
 
#define IS_SIGNAL_CONNECTED(Sender, SenderType, Name, Arguments)
 

Functions

QT_BEGIN_NAMESPACE bool qmlConvertBoolConfigOption (const char *v)
 
template<typename T, T(*)(const char *) Convert>
qmlGetConfigOption (const char *var)
 
Q_QML_EXPORT bool qmlobject_can_cpp_cast (QObject *object, const QMetaObject *mo)
 
Q_QML_EXPORT bool qmlobject_can_qml_cast (QObject *object, const QQmlType &type)
 
template<class T>
qmlobject_cast (QObject *object)
 This method is identical to qobject_cast<T>() except that it does not require lazy QMetaObjects to be built, so should be preferred in all QML code that might interact with QML built objects.
 
template<>
QQuickItemqmlobject_cast< QQuickItem * > (QObject *object)
 
bool QQml_isFileCaseCorrect (const QString &fileName, int length=-1)
 Returns true if the case of fileName is equivalent to the file case of fileName on disk, and false otherwise.
 
void QQml_setParent_noEvent (QObject *object, QObject *parent)
 Makes the object a child of parent.
 
Q_QML_EXPORT QQmlColorProviderQQml_setColorProvider (QQmlColorProvider *)
 
Q_QML_EXPORT QQmlColorProviderQQml_colorProvider ()
 
Q_QML_EXPORT QQmlGuiProviderQQml_setGuiProvider (QQmlGuiProvider *)
 
Q_AUTOTEST_EXPORT QQmlGuiProviderQQml_guiProvider ()
 

Macro Definition Documentation

◆ DEFINE_BOOL_CONFIG_OPTION

#define DEFINE_BOOL_CONFIG_OPTION ( name,
var )
Value:
static bool name() \
{ \
return result; \
}
EGLImageKHR EGLint * name
GLuint64EXT * result
[6]
T qmlGetConfigOption(const char *var)

Definition at line 41 of file qqmlglobal_p.h.

◆ IS_SIGNAL_CONNECTED

#define IS_SIGNAL_CONNECTED ( Sender,
SenderType,
Name,
Arguments )
Value:
do { \
QObject *sender = (Sender); \
void (SenderType::*signal)Arguments = &SenderType::Name; \
static int signalIdx = QMetaObjectPrivate::signalIndex(method); \
return QObjectPrivate::get(sender)->isSignalConnected(signalIdx); \
} while (0)
\inmodule QtCore
Definition qmetaobject.h:19
static QMetaMethod fromSignal(PointerToMemberFunction signal)
bool isSignalConnected(uint signalIdx, bool checkDeclarative=true) const
Definition qobject.cpp:420
static QObjectPrivate * get(QObject *o)
Definition qobject_p.h:160
\inmodule QtCore
Definition qobject.h:105
auto signal
DBusConnection const char DBusError DBusBusType DBusError return DBusConnection DBusHandleMessageFunction void DBusFreeFunction return DBusConnection return DBusConnection return const char DBusError return DBusConnection DBusMessage dbus_uint32_t return DBusConnection dbus_bool_t DBusConnection DBusAddWatchFunction DBusRemoveWatchFunction DBusWatchToggledFunction void DBusFreeFunction return DBusConnection DBusDispatchStatusFunction void DBusFreeFunction DBusTimeout return DBusTimeout return DBusWatch return DBusWatch unsigned int return DBusError const DBusError return const DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessage return DBusMessageIter int const void return DBusMessageIter DBusMessageIter return DBusMessageIter void DBusMessageIter void int return DBusMessage DBusMessageIter return DBusMessageIter return DBusMessageIter DBusMessageIter const char const char const char const char * method
static Q_CORE_EXPORT int signalIndex(const QMetaMethod &m)

Definition at line 163 of file qqmlglobal_p.h.

◆ qmlobject_connect

#define qmlobject_connect ( Sender,
SenderType,
Signal,
Receiver,
ReceiverType,
Method )
Value:
do { \
SenderType *sender = (Sender); \
ReceiverType *receiver = (Receiver); \
const char *signal = (Signal); \
const char *method = (Method); \
static int signalIdx = -1; \
static int methodIdx = -1; \
if (signalIdx < 0) { \
Q_ASSERT((int(*signal) - '0') == QSIGNAL_CODE); \
signalIdx = SenderType::staticMetaObject.indexOfSignal(signal+1); \
} \
if (methodIdx < 0) { \
int code = (int(*method) - '0'); \
Q_ASSERT(code == QSLOT_CODE || code == QSIGNAL_CODE); \
if (code == QSLOT_CODE) \
methodIdx = ReceiverType::staticMetaObject.indexOfSlot(method+1); \
else \
methodIdx = ReceiverType::staticMetaObject.indexOfSignal(method+1); \
} \
Q_ASSERT(signalIdx != -1 && methodIdx != -1); \
QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); \
} while (0)
@ DirectConnection
#define QSIGNAL_CODE
Definition qobjectdefs.h:42
#define QSLOT_CODE
Definition qobjectdefs.h:41

Connect Signal of Sender to Method of Receiver.

Signal must be of type SenderType and Receiver of type ReceiverType.

Unlike QObject::connect(), this macro caches the lookup of the signal and method indexes. It also does not require lazy QMetaObjects to be built so should be preferred in all QML code that might interact with QML built objects.

textEdit, QQuickTextEdit, SLOT(updateDocument()));
\inmodule QtCore\reentrant
Definition qrect.h:509
#define SLOT(a)
Definition qobjectdefs.h:52
#define SIGNAL(a)
Definition qobjectdefs.h:53
#define qmlobject_connect(Sender, SenderType, Signal, Receiver, ReceiverType, Method)
Connect Signal of Sender to Method of Receiver.
QGraphicsWidget * textEdit

Definition at line 63 of file qqmlglobal_p.h.

◆ qmlobject_disconnect

#define qmlobject_disconnect ( Sender,
SenderType,
Signal,
Receiver,
ReceiverType,
Method )
Value:
do { \
SenderType *sender = (Sender); \
ReceiverType *receiver = (Receiver); \
const char *signal = (Signal); \
const char *method = (Method); \
static int signalIdx = -1; \
static int methodIdx = -1; \
if (signalIdx < 0) { \
Q_ASSERT((int(*signal) - '0') == QSIGNAL_CODE); \
signalIdx = SenderType::staticMetaObject.indexOfSignal(signal+1); \
} \
if (methodIdx < 0) { \
int code = (int(*method) - '0'); \
Q_ASSERT(code == QSLOT_CODE || code == QSIGNAL_CODE); \
if (code == QSLOT_CODE) \
methodIdx = ReceiverType::staticMetaObject.indexOfSlot(method+1); \
else \
methodIdx = ReceiverType::staticMetaObject.indexOfSignal(method+1); \
} \
Q_ASSERT(signalIdx != -1 && methodIdx != -1); \
QMetaObject::disconnect(sender, signalIdx, receiver, methodIdx); \
} while (0)

Disconnect Signal of Sender from Method of Receiver.

Signal must be of type SenderType and Receiver of type ReceiverType.

Unlike QObject::disconnect(), this macro caches the lookup of the signal and method indexes. It also does not require lazy QMetaObjects to be built so should be preferred in all QML code that might interact with QML built objects.

textEdit, QQuickTextEdit, SLOT(updateDocument()));
#define qmlobject_disconnect(Sender, SenderType, Signal, Receiver, ReceiverType, Method)
Disconnect Signal of Sender from Method of Receiver.

Definition at line 102 of file qqmlglobal_p.h.

Function Documentation

◆ qmlConvertBoolConfigOption()

QT_BEGIN_NAMESPACE bool qmlConvertBoolConfigOption ( const char * v)
inline

Definition at line 28 of file qqmlglobal_p.h.

◆ qmlGetConfigOption()

template<typename T, T(*)(const char *) Convert>
T qmlGetConfigOption ( const char * var)

Definition at line 34 of file qqmlglobal_p.h.

◆ qmlobject_can_cpp_cast()

bool qmlobject_can_cpp_cast ( QObject * object,
const QMetaObject * mo )

Definition at line 1090 of file qqmlglobal.cpp.

◆ qmlobject_can_qml_cast()

bool qmlobject_can_qml_cast ( QObject * object,
const QQmlType & type )

Definition at line 1098 of file qqmlglobal.cpp.

◆ qmlobject_cast()

template<class T>
T qmlobject_cast ( QObject * object)

This method is identical to qobject_cast<T>() except that it does not require lazy QMetaObjects to be built, so should be preferred in all QML code that might interact with QML built objects.

// ...Do something...
}
GLuint object
[3]
T qmlobject_cast(QObject *object)
This method is identical to qobject_cast<T>() except that it does not require lazy QMetaObjects to be...

Definition at line 142 of file qqmlglobal_p.h.

◆ qmlobject_cast< QQuickItem * >()

template<>
QQuickItem * qmlobject_cast< QQuickItem * > ( QObject * object)
inline

Definition at line 154 of file qqmlglobal_p.h.

◆ QQml_colorProvider()

Q_AUTOTEST_EXPORT QQmlColorProvider * QQml_colorProvider ( void )

Definition at line 953 of file qqmlglobal.cpp.

◆ QQml_guiProvider()

Q_AUTOTEST_EXPORT QQmlGuiProvider * QQml_guiProvider ( void )

Definition at line 1006 of file qqmlglobal.cpp.

◆ QQml_isFileCaseCorrect()

bool QQml_isFileCaseCorrect ( const QString & fileName,
int length = -1 )

Returns true if the case of fileName is equivalent to the file case of fileName on disk, and false otherwise.

This is used to ensure that the behavior of QML on a case-insensitive file system is the same as on a case-sensitive file system. This function performs a "best effort" attempt to determine the real case of the file. It may have false positives (say the case is correct when it isn't), but it should never have a false negative (say the case is incorrect when it is correct).

Length specifies specifies the number of characters to be checked from behind. That is, if a file name results from a relative path specification like "foo/bar.qml" and is made absolute, the original length (11) should be passed indicating that only the last part of the relative path should be checked.

Definition at line 2057 of file qqmlengine.cpp.

◆ QQml_setColorProvider()

Q_QML_EXPORT QQmlColorProvider * QQml_setColorProvider ( QQmlColorProvider * newProvider)

Definition at line 935 of file qqmlglobal.cpp.

◆ QQml_setGuiProvider()

Q_QML_EXPORT QQmlGuiProvider * QQml_setGuiProvider ( QQmlGuiProvider * newProvider)

Definition at line 989 of file qqmlglobal.cpp.

◆ QQml_setParent_noEvent()

void QQml_setParent_noEvent ( QObject * object,
QObject * parent )
inline

Makes the object a child of parent.

Note that when using this method, neither parent nor the object's previous parent (if it had one) will receive ChildRemoved or ChildAdded events.

Definition at line 197 of file qqmlglobal_p.h.