diff options
author | Sergio Ahumada <sergio.ahumada@nokia.com> | 2012-08-31 23:48:30 +0200 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-09-03 11:05:49 +0200 |
commit | 8cba00ebf55090d717e41c14f5f1044faac578a7 (patch) | |
tree | 5644c4a5add623fb00be1b1d9f16c281755ce3e1 /src | |
parent | a36efc37a1941a4b4cb239fa2ca0bc12ab7569ec (diff) |
Private slots should be named starting with _q_
This is to reduce the risk of collisions with signals/slots in user classes
q_updateFocusObject(QObject *object) => _q_updateFocusObject(QObject *object)
q_checkFocusObject(QObject *object) => _q_checkFocusObject(QObject *object)
q_connectFocusObject() => _q_connectFocusObject()
emitActivated(QPlatformSystemTrayIcon::ActivationReason) => _q_emitActivated(QPlatformSystemTrayIcon::ActivationReason)
Change-Id: I148913f1e24a80fe5cacfd737d1b455b805cfced
Reviewed-by: Christoph Schleifenbaum <christoph.schleifenbaum@kdab.com>
Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 8 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qguiapplication_p.h | 2 | ||||
-rw-r--r-- | src/gui/kernel/qinputmethod.cpp | 10 | ||||
-rw-r--r-- | src/gui/kernel/qinputmethod.h | 5 | ||||
-rw-r--r-- | src/gui/kernel/qinputmethod_p.h | 4 | ||||
-rw-r--r-- | src/widgets/util/qsystemtrayicon.cpp | 2 | ||||
-rw-r--r-- | src/widgets/util/qsystemtrayicon.h | 2 | ||||
-rw-r--r-- | src/widgets/util/qsystemtrayicon_p.h | 2 |
9 files changed, 19 insertions, 18 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index a7e9deab89..61d52ff28b 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1410,7 +1410,7 @@ void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate QFocusEvent focusOut(QEvent::FocusOut); QCoreApplication::sendSpontaneousEvent(previous, &focusOut); QObject::disconnect(previous, SIGNAL(focusObjectChanged(QObject*)), - qApp, SLOT(q_updateFocusObject(QObject*))); + qApp, SLOT(_q_updateFocusObject(QObject*))); } else { QEvent appActivate(QEvent::ApplicationActivate); qApp->sendSpontaneousEvent(qApp, &appActivate); @@ -1420,7 +1420,7 @@ void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate QFocusEvent focusIn(QEvent::FocusIn); QCoreApplication::sendSpontaneousEvent(QGuiApplicationPrivate::focus_window, &focusIn); QObject::connect(QGuiApplicationPrivate::focus_window, SIGNAL(focusObjectChanged(QObject*)), - qApp, SLOT(q_updateFocusObject(QObject*))); + qApp, SLOT(_q_updateFocusObject(QObject*))); } else { QEvent appActivate(QEvent::ApplicationDeactivate); qApp->sendSpontaneousEvent(qApp, &appActivate); @@ -1430,7 +1430,7 @@ void QGuiApplicationPrivate::processActivatedEvent(QWindowSystemInterfacePrivate self->notifyActiveWindowChange(previous); if (previousFocusObject != qApp->focusObject()) - self->q_updateFocusObject(qApp->focusObject()); + self->_q_updateFocusObject(qApp->focusObject()); } emit qApp->focusWindowChanged(newFocus); @@ -2543,7 +2543,7 @@ const QDrawHelperGammaTables *QGuiApplicationPrivate::gammaTables() return result; } -void QGuiApplicationPrivate::q_updateFocusObject(QObject *object) +void QGuiApplicationPrivate::_q_updateFocusObject(QObject *object) { Q_Q(QGuiApplication); diff --git a/src/gui/kernel/qguiapplication.h b/src/gui/kernel/qguiapplication.h index 9d90cde993..1c0ce17f3f 100644 --- a/src/gui/kernel/qguiapplication.h +++ b/src/gui/kernel/qguiapplication.h @@ -158,7 +158,7 @@ private: Q_DISABLE_COPY(QGuiApplication) Q_DECLARE_PRIVATE(QGuiApplication) - Q_PRIVATE_SLOT(d_func(), void q_updateFocusObject(QObject *object)) + Q_PRIVATE_SLOT(d_func(), void _q_updateFocusObject(QObject *object)) #ifndef QT_NO_GESTURES friend class QGestureManager; diff --git a/src/gui/kernel/qguiapplication_p.h b/src/gui/kernel/qguiapplication_p.h index 58a82a9cc5..21f57513d9 100644 --- a/src/gui/kernel/qguiapplication_p.h +++ b/src/gui/kernel/qguiapplication_p.h @@ -162,7 +162,7 @@ public: QPixmap getPixmapCursor(Qt::CursorShape cshape); - void q_updateFocusObject(QObject *object); + void _q_updateFocusObject(QObject *object); static QGuiApplicationPrivate *instance() { return self; } diff --git a/src/gui/kernel/qinputmethod.cpp b/src/gui/kernel/qinputmethod.cpp index c8d143c70c..ec2c3ed48c 100644 --- a/src/gui/kernel/qinputmethod.cpp +++ b/src/gui/kernel/qinputmethod.cpp @@ -54,7 +54,7 @@ QInputMethod::QInputMethod() : QObject(*new QInputMethodPrivate) { // might be instantiated before QGuiApplication is fully done, need to connect later - QTimer::singleShot(0, this, SLOT(q_connectFocusObject())); + QTimer::singleShot(0, this, SLOT(_q_connectFocusObject())); } /*! @@ -358,15 +358,15 @@ void QInputMethod::invokeAction(Action a, int cursorPosition) } // temporary handlers for updating focus item based on application focus -void QInputMethodPrivate::q_connectFocusObject() +void QInputMethodPrivate::_q_connectFocusObject() { Q_Q(QInputMethod); QObject::connect(qApp, SIGNAL(focusObjectChanged(QObject*)), - q, SLOT(q_checkFocusObject(QObject*))); - q_checkFocusObject(qApp->focusObject()); + q, SLOT(_q_checkFocusObject(QObject*))); + _q_checkFocusObject(qApp->focusObject()); } -void QInputMethodPrivate::q_checkFocusObject(QObject *object) +void QInputMethodPrivate::_q_checkFocusObject(QObject *object) { bool enabled = objectAcceptsInputMethod(object); setInputItem(enabled ? object : 0); diff --git a/src/gui/kernel/qinputmethod.h b/src/gui/kernel/qinputmethod.h index 095c17ffd8..4b21e4ac15 100644 --- a/src/gui/kernel/qinputmethod.h +++ b/src/gui/kernel/qinputmethod.h @@ -129,8 +129,9 @@ private: QInputMethod(); ~QInputMethod(); - Q_PRIVATE_SLOT(d_func(), void q_connectFocusObject()) - Q_PRIVATE_SLOT(d_func(), void q_checkFocusObject(QObject* object)) + Q_PRIVATE_SLOT(d_func(), void _q_connectFocusObject()) + Q_PRIVATE_SLOT(d_func(), void _q_checkFocusObject(QObject* object)) + }; QT_END_NAMESPACE diff --git a/src/gui/kernel/qinputmethod_p.h b/src/gui/kernel/qinputmethod_p.h index 7b24ebe33d..69d3f2d065 100644 --- a/src/gui/kernel/qinputmethod_p.h +++ b/src/gui/kernel/qinputmethod_p.h @@ -80,8 +80,8 @@ public: emit q->inputItemChanged(); } - void q_connectFocusObject(); - void q_checkFocusObject(QObject *object); + void _q_connectFocusObject(); + void _q_checkFocusObject(QObject *object); bool objectAcceptsInputMethod(QObject *object); QTransform inputItemTransform; diff --git a/src/widgets/util/qsystemtrayicon.cpp b/src/widgets/util/qsystemtrayicon.cpp index 343a3c115b..9e667b1781 100644 --- a/src/widgets/util/qsystemtrayicon.cpp +++ b/src/widgets/util/qsystemtrayicon.cpp @@ -391,7 +391,7 @@ void QSystemTrayIcon::showMessage(const QString& title, const QString& msg, d->showMessage_sys(title, msg, icon, msecs); } -void QSystemTrayIconPrivate::emitActivated(QPlatformSystemTrayIcon::ActivationReason reason) +void QSystemTrayIconPrivate::_q_emitActivated(QPlatformSystemTrayIcon::ActivationReason reason) { Q_Q(QSystemTrayIcon); emit q->activated(static_cast<QSystemTrayIcon::ActivationReason>(reason)); diff --git a/src/widgets/util/qsystemtrayicon.h b/src/widgets/util/qsystemtrayicon.h index ee640b2f78..870081ef3e 100644 --- a/src/widgets/util/qsystemtrayicon.h +++ b/src/widgets/util/qsystemtrayicon.h @@ -118,7 +118,7 @@ private: Q_DISABLE_COPY(QSystemTrayIcon) Q_DECLARE_PRIVATE(QSystemTrayIcon) - Q_PRIVATE_SLOT(d_func(), void emitActivated(QPlatformSystemTrayIcon::ActivationReason)) + Q_PRIVATE_SLOT(d_func(), void _q_emitActivated(QPlatformSystemTrayIcon::ActivationReason)) friend class QSystemTrayIconSys; friend class QBalloonTip; diff --git a/src/widgets/util/qsystemtrayicon_p.h b/src/widgets/util/qsystemtrayicon_p.h index 3ab2ebc100..6650b4ce6b 100644 --- a/src/widgets/util/qsystemtrayicon_p.h +++ b/src/widgets/util/qsystemtrayicon_p.h @@ -90,7 +90,7 @@ public: static bool isSystemTrayAvailable_sys(); static bool supportsMessages_sys(); - void emitActivated(QPlatformSystemTrayIcon::ActivationReason reason); + void _q_emitActivated(QPlatformSystemTrayIcon::ActivationReason reason); QPointer<QMenu> menu; QIcon icon; |