From 10947feec131b408dd7f5761d07d5e1cf4511728 Mon Sep 17 00:00:00 2001 From: J-P Nurmi <jpnurmi@digia.com> Date: Fri, 12 Apr 2013 16:16:50 +0200 Subject: [PATCH] Rename QtExclusiveGroup to QQuickExclusiveGroup Change-Id: Ic3b95c40d2698343fdeed30db5ad8a0ec3f8df22 Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com> --- src/controls/plugin.cpp | 4 ++-- src/controls/plugin.pri | 4 ++-- src/controls/qquickaction.cpp | 6 ++--- src/controls/qquickaction_p.h | 10 ++++---- ...sivegroup.cpp => qquickexclusivegroup.cpp} | 24 +++++++++---------- ...sivegroup_p.h => qquickexclusivegroup_p.h} | 10 ++++---- src/controls/qtmenuitem.cpp | 4 ++-- src/controls/qtmenuitem_p.h | 8 +++---- 8 files changed, 35 insertions(+), 35 deletions(-) rename src/controls/{qtexclusivegroup.cpp => qquickexclusivegroup.cpp} (90%) rename src/controls/{qtexclusivegroup_p.h => qquickexclusivegroup_p.h} (93%) diff --git a/src/controls/plugin.cpp b/src/controls/plugin.cpp index 8af5349b5..98d81e42c 100644 --- a/src/controls/plugin.cpp +++ b/src/controls/plugin.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qquickaction_p.h" -#include "qtexclusivegroup_p.h" +#include "qquickexclusivegroup_p.h" #include "qtmenu_p.h" #include "qtmenubar_p.h" #include "qtstack_p.h" @@ -87,7 +87,7 @@ public: void QtQuickControlsPlugin::registerTypes(const char *uri) { qmlRegisterType<QQuickAction>(uri, 1, 0, "Action"); - qmlRegisterType<QtExclusiveGroup>(uri, 1, 0, "ExclusiveGroup"); + qmlRegisterType<QQuickExclusiveGroup>(uri, 1, 0, "ExclusiveGroup"); qmlRegisterType<QtMenu>(uri, 1, 0, "MenuPrivate"); qmlRegisterType<QtMenuBar>(uri, 1, 0, "MenuBarPrivate"); qmlRegisterType<QtMenuItem>(uri, 1, 0, "MenuItem"); diff --git a/src/controls/plugin.pri b/src/controls/plugin.pri index 20fc1f680..1658a3909 100644 --- a/src/controls/plugin.pri +++ b/src/controls/plugin.pri @@ -1,6 +1,6 @@ HEADERS += \ $$PWD/qquickaction_p.h \ - $$PWD/qtexclusivegroup_p.h \ + $$PWD/qquickexclusivegroup_p.h \ $$PWD/qtmenu_p.h \ $$PWD/qtmenubar_p.h \ $$PWD/qtmenuitem_p.h \ @@ -11,7 +11,7 @@ HEADERS += \ SOURCES += \ $$PWD/plugin.cpp \ $$PWD/qquickaction.cpp \ - $$PWD/qtexclusivegroup.cpp \ + $$PWD/qquickexclusivegroup.cpp \ $$PWD/qtmenu.cpp \ $$PWD/qtmenubar.cpp \ $$PWD/qtmenuitem.cpp \ diff --git a/src/controls/qquickaction.cpp b/src/controls/qquickaction.cpp index eceac9043..c9dde259b 100644 --- a/src/controls/qquickaction.cpp +++ b/src/controls/qquickaction.cpp @@ -40,7 +40,7 @@ ****************************************************************************/ #include "qquickaction_p.h" -#include "qtexclusivegroup_p.h" +#include "qquickexclusivegroup_p.h" #include <private/qguiapplication_p.h> #include <qqmlfile.h> @@ -305,12 +305,12 @@ void QQuickAction::setChecked(bool c) emit toggled(m_checked); } -QtExclusiveGroup *QQuickAction::exclusiveGroup() const +QQuickExclusiveGroup *QQuickAction::exclusiveGroup() const { return m_exclusiveGroup.data(); } -void QQuickAction::setExclusiveGroup(QtExclusiveGroup *eg) +void QQuickAction::setExclusiveGroup(QQuickExclusiveGroup *eg) { if (m_exclusiveGroup == eg) return; diff --git a/src/controls/qquickaction_p.h b/src/controls/qquickaction_p.h index 65770d2b0..e106a9206 100644 --- a/src/controls/qquickaction_p.h +++ b/src/controls/qquickaction_p.h @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE -class QtExclusiveGroup; +class QQuickExclusiveGroup; class QQuickAction : public QObject { @@ -66,7 +66,7 @@ class QQuickAction : public QObject Q_PROPERTY(bool checkable READ isCheckable WRITE setCheckable NOTIFY checkableChanged) Q_PROPERTY(bool checked READ isChecked WRITE setChecked DESIGNABLE isCheckable NOTIFY toggled) - Q_PROPERTY(QtExclusiveGroup *exclusiveGroup READ exclusiveGroup WRITE setExclusiveGroup NOTIFY exclusiveGroupChanged) + Q_PROPERTY(QQuickExclusiveGroup *exclusiveGroup READ exclusiveGroup WRITE setExclusiveGroup NOTIFY exclusiveGroupChanged) #ifndef QT_NO_SHORTCUT Q_PROPERTY(QString shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged) #endif @@ -101,8 +101,8 @@ public: bool isChecked() const { return m_checkable && m_checked; } void setChecked(bool c); - QtExclusiveGroup *exclusiveGroup() const; - void setExclusiveGroup(QtExclusiveGroup *arg); + QQuickExclusiveGroup *exclusiveGroup() const; + void setExclusiveGroup(QQuickExclusiveGroup *arg); QIcon icon() const { return m_icon; } QVariant iconVariant() const { return QVariant(m_icon); } @@ -137,7 +137,7 @@ private: bool m_enabled; bool m_checkable; bool m_checked; - QPointer<QtExclusiveGroup> m_exclusiveGroup; + QPointer<QQuickExclusiveGroup> m_exclusiveGroup; QKeySequence m_shortcut; QKeySequence m_mnemonic; QString m_tooltip; diff --git a/src/controls/qtexclusivegroup.cpp b/src/controls/qquickexclusivegroup.cpp similarity index 90% rename from src/controls/qtexclusivegroup.cpp rename to src/controls/qquickexclusivegroup.cpp index 9bf36d607..e7ddb2d0b 100644 --- a/src/controls/qtexclusivegroup.cpp +++ b/src/controls/qquickexclusivegroup.cpp @@ -39,7 +39,7 @@ ** ****************************************************************************/ -#include "qtexclusivegroup_p.h" +#include "qquickexclusivegroup_p.h" #include <qvariant.h> #include <qdebug.h> @@ -65,7 +65,7 @@ static bool isChecked(const QObject *o) /*! \qmltype ExclusiveGroup - \instantiates QtExclusiveGroup + \instantiates QQuickExclusiveGroup \inqmlmodule QtQuick.Controls 1.0 \brief ExclusiveGroup provides a way to declare several checkable controls as mutually exclusive. @@ -178,25 +178,25 @@ static bool isChecked(const QObject *o) \sa ExclusiveGroup::bindCheckable(object) */ -QtExclusiveGroup::QtExclusiveGroup(QObject *parent) +QQuickExclusiveGroup::QQuickExclusiveGroup(QObject *parent) : QObject(parent), m_current(0) { int index = metaObject()->indexOfMethod("updateCurrent()"); m_updateCurrentMethod = metaObject()->method(index); } -QQmlListProperty<QQuickAction> QtExclusiveGroup::actions() +QQmlListProperty<QQuickAction> QQuickExclusiveGroup::actions() { - return QQmlListProperty<QQuickAction>(this, 0, &QtExclusiveGroup::append_actions, 0, 0, 0); + return QQmlListProperty<QQuickAction>(this, 0, &QQuickExclusiveGroup::append_actions, 0, 0, 0); } -void QtExclusiveGroup::append_actions(QQmlListProperty<QQuickAction> *list, QQuickAction *action) +void QQuickExclusiveGroup::append_actions(QQmlListProperty<QQuickAction> *list, QQuickAction *action) { - if (QtExclusiveGroup *eg = qobject_cast<QtExclusiveGroup *>(list->object)) + if (QQuickExclusiveGroup *eg = qobject_cast<QQuickExclusiveGroup *>(list->object)) action->setExclusiveGroup(eg); } -void QtExclusiveGroup::setCurrent(QObject * o) +void QQuickExclusiveGroup::setCurrent(QObject * o) { if (m_current == o) return; @@ -209,14 +209,14 @@ void QtExclusiveGroup::setCurrent(QObject * o) emit currentChanged(); } -void QtExclusiveGroup::updateCurrent() +void QQuickExclusiveGroup::updateCurrent() { QObject *checkable = sender(); if (isChecked(checkable)) setCurrent(checkable); } -void QtExclusiveGroup::bindCheckable(QObject *o) +void QQuickExclusiveGroup::bindCheckable(QObject *o) { for (const char **signalName = checkableSignals; *signalName; signalName++) { int signalIndex = o->metaObject()->indexOfSignal(*signalName); @@ -230,10 +230,10 @@ void QtExclusiveGroup::bindCheckable(QObject *o) } } - qWarning() << "QtExclusiveGroup::bindCheckable(): Cannot bind to" << o; + qWarning() << "QQuickExclusiveGroup::bindCheckable(): Cannot bind to" << o; } -void QtExclusiveGroup::unbindCheckable(QObject *o) +void QQuickExclusiveGroup::unbindCheckable(QObject *o) { if (m_current == o) setCurrent(0); diff --git a/src/controls/qtexclusivegroup_p.h b/src/controls/qquickexclusivegroup_p.h similarity index 93% rename from src/controls/qtexclusivegroup_p.h rename to src/controls/qquickexclusivegroup_p.h index e2127d379..0b9b5c04f 100644 --- a/src/controls/qtexclusivegroup_p.h +++ b/src/controls/qquickexclusivegroup_p.h @@ -39,8 +39,8 @@ ** ****************************************************************************/ -#ifndef QTEXCLUSIVEGROUP_H -#define QTEXCLUSIVEGROUP_H +#ifndef QQUICKEXCLUSIVEGROUP_H +#define QQUICKEXCLUSIVEGROUP_H #include <QtCore/qobject.h> #include <QtCore/qmetaobject.h> @@ -50,7 +50,7 @@ QT_BEGIN_NAMESPACE class QQuickAction; -class QtExclusiveGroup : public QObject +class QQuickExclusiveGroup : public QObject { Q_OBJECT @@ -59,7 +59,7 @@ class QtExclusiveGroup : public QObject Q_CLASSINFO("DefaultProperty", "__actions") public: - explicit QtExclusiveGroup(QObject *parent = 0); + explicit QQuickExclusiveGroup(QObject *parent = 0); QObject *current() const { return m_current; } void setCurrent(QObject * o); @@ -85,4 +85,4 @@ private: QT_END_NAMESPACE -#endif // QTEXCLUSIVEGROUP_H +#endif // QQUICKEXCLUSIVEGROUP_H diff --git a/src/controls/qtmenuitem.cpp b/src/controls/qtmenuitem.cpp index b74b8ac74..400fe2c97 100644 --- a/src/controls/qtmenuitem.cpp +++ b/src/controls/qtmenuitem.cpp @@ -582,12 +582,12 @@ void QtMenuItem::updateChecked() emit toggled(checked); } -QtExclusiveGroup *QtMenuItem::exclusiveGroup() const +QQuickExclusiveGroup *QtMenuItem::exclusiveGroup() const { return action()->exclusiveGroup(); } -void QtMenuItem::setExclusiveGroup(QtExclusiveGroup *eg) +void QtMenuItem::setExclusiveGroup(QQuickExclusiveGroup *eg) { if (!m_boundAction) action()->setExclusiveGroup(eg); diff --git a/src/controls/qtmenuitem_p.h b/src/controls/qtmenuitem_p.h index c78ac9e44..f2036911b 100644 --- a/src/controls/qtmenuitem_p.h +++ b/src/controls/qtmenuitem_p.h @@ -55,7 +55,7 @@ class QUrl; class QPlatformMenuItem; class QQuickItem; class QQuickAction; -class QtExclusiveGroup; +class QQuickExclusiveGroup; class QtMenu; class QtMenuItemContainer; @@ -177,7 +177,7 @@ class QtMenuItem: public QtMenuText Q_PROPERTY(QString text READ text WRITE setText NOTIFY textChanged) Q_PROPERTY(bool checkable READ checkable WRITE setCheckable NOTIFY checkableChanged) Q_PROPERTY(bool checked READ checked WRITE setChecked NOTIFY toggled) - Q_PROPERTY(QtExclusiveGroup *exclusiveGroup READ exclusiveGroup WRITE setExclusiveGroup NOTIFY exclusiveGroupChanged) + Q_PROPERTY(QQuickExclusiveGroup *exclusiveGroup READ exclusiveGroup WRITE setExclusiveGroup NOTIFY exclusiveGroupChanged) Q_PROPERTY(QString shortcut READ shortcut WRITE setShortcut NOTIFY shortcutChanged) Q_PROPERTY(QQuickAction *action READ boundAction WRITE setBoundAction NOTIFY actionChanged) @@ -217,8 +217,8 @@ public: bool checked() const; void setChecked(bool checked); - QtExclusiveGroup *exclusiveGroup() const; - void setExclusiveGroup(QtExclusiveGroup *); + QQuickExclusiveGroup *exclusiveGroup() const; + void setExclusiveGroup(QQuickExclusiveGroup *); void setParentMenu(QtMenu *parentMenu); -- GitLab