diff --git a/src/controls/plugin.cpp b/src/controls/plugin.cpp index 8af5349b56380f6db33a3856847ae6dcc91c31e2..98d81e42c52732d904a2103dc0a30d2f4fde29d3 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 20fc1f680bad424d282f64f72218eac3b5cb71e7..1658a3909d624990aa663941cc20eac39aff2a6f 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 eceac9043b1de0f982a0db59773d14ff2f205819..c9dde259bb7ce897cecb3a9511c5f1bebd9c63f9 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 65770d2b071a14d1d86c731aa77c09d89ad89c3e..e106a9206b689133b69333fdad9fc5ab2aeaac9b 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 9bf36d607807e70a0239380645cc988c4613de68..e7ddb2d0bde2d9001b8c02f34a7201ae0a60db1d 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 e2127d3795f9660b97088eb86600f8a0d8dbf4c0..0b9b5c04fc63b6bab8be50685553879eb4be749f 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 b74b8ac7452aaef02ae53a87ba1261d954d2da75..400fe2c97d07d4c03ed0d28ef4178b1ef9496225 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 c78ac9e44d1952619bf205febe2663260f5c037c..f2036911b8d724a5b7555ed6f66b59fc40fc285f 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);