aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmlglobal_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/qml/qml/qqmlglobal_p.h')
-rw-r--r--src/qml/qml/qqmlglobal_p.h15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/qml/qml/qqmlglobal_p.h b/src/qml/qml/qqmlglobal_p.h
index 2356b2d122..04711ae3fc 100644
--- a/src/qml/qml/qqmlglobal_p.h
+++ b/src/qml/qml/qqmlglobal_p.h
@@ -89,6 +89,21 @@ QT_BEGIN_NAMESPACE
QMetaObject::connect(sender, signalIdx, receiver, methodIdx, Qt::DirectConnection); \
}
+bool Q_QML_EXPORT QQml_isSignalConnected(QObject*, int, int);
+
+#define IS_SIGNAL_CONNECTED(Sender, Signal) \
+do { \
+ QObject *sender = (Sender); \
+ const char *signal = (Signal); \
+ static int signalIdx = -1; \
+ static int methodIdx = -1; \
+ if (signalIdx < 0) { \
+ signalIdx = QObjectPrivate::get(sender)->signalIndex(signal); \
+ methodIdx = sender->metaObject()->indexOfSignal(signal); \
+ } \
+ return QQml_isSignalConnected(sender, signalIdx, methodIdx); \
+} while (0)
+
struct QQmlGraphics_DerivedObject : public QObject
{
void setParent_noEvent(QObject *parent) {