diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2012-04-02 10:02:28 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-04-23 05:23:45 +0200 |
commit | 66399c6584a86180c1955e5d34617fa46b07f36e (patch) | |
tree | c6ed009879801ff7c2d13b696c7963ed08c809c6 /src/qml/qml/qqmlglobal_p.h | |
parent | 9542511b013588b2ceb132ec8b34879ec904a21e (diff) |
Also check notifier endpoints when checking whether a signal is connected.
This is required for the QQmlBoundSignal optimizations.
Change-Id: I63540b96cd7d4523ec49973a2540054c83d82b12
Reviewed-by: Chris Adams <christopher.adams@nokia.com>
Diffstat (limited to 'src/qml/qml/qqmlglobal_p.h')
-rw-r--r-- | src/qml/qml/qqmlglobal_p.h | 15 |
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) { |