aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/controls/qquickexclusivegroup.cpp26
-rw-r--r--src/controls/qquickexclusivegroup_p.h4
2 files changed, 21 insertions, 9 deletions
diff --git a/src/controls/qquickexclusivegroup.cpp b/src/controls/qquickexclusivegroup.cpp
index 325dfe19..5144bf92 100644
--- a/src/controls/qquickexclusivegroup.cpp
+++ b/src/controls/qquickexclusivegroup.cpp
@@ -141,8 +141,16 @@ void QQuickExclusiveGroup::removeCheckable(QObject *object)
TODO
*/
+class QQuickExclusiveAttachedPrivate : public QObjectPrivate
+{
+public:
+ QQuickExclusiveAttachedPrivate() : group(Q_NULLPTR) { }
+
+ QQuickExclusiveGroup *group;
+};
+
QQuickExclusiveAttached::QQuickExclusiveAttached(QObject *parent) :
- QObject(parent), m_group(Q_NULLPTR)
+ QObject(*(new QQuickExclusiveAttachedPrivate), parent)
{
}
@@ -158,17 +166,19 @@ QQuickExclusiveAttached *QQuickExclusiveAttached::qmlAttachedProperties(QObject
*/
QQuickExclusiveGroup *QQuickExclusiveAttached::group() const
{
- return m_group;
+ Q_D(const QQuickExclusiveAttached);
+ return d->group;
}
void QQuickExclusiveAttached::setGroup(QQuickExclusiveGroup *group)
{
- if (m_group != group) {
- if (m_group)
- m_group->removeCheckable(parent());
- m_group = group;
- if (m_group)
- m_group->addCheckable(parent());
+ Q_D(QQuickExclusiveAttached);
+ if (d->group != group) {
+ if (d->group)
+ d->group->removeCheckable(parent());
+ d->group = group;
+ if (group)
+ group->addCheckable(parent());
emit groupChanged();
}
}
diff --git a/src/controls/qquickexclusivegroup_p.h b/src/controls/qquickexclusivegroup_p.h
index ce000c50..100b7725 100644
--- a/src/controls/qquickexclusivegroup_p.h
+++ b/src/controls/qquickexclusivegroup_p.h
@@ -55,6 +55,7 @@
QT_BEGIN_NAMESPACE
class QQuickExclusiveGroupPrivate;
+class QQuickExclusiveAttachedPrivate;
class Q_QUICKCONTROLS_EXPORT QQuickExclusiveGroup : public QObject
{
@@ -98,7 +99,8 @@ Q_SIGNALS:
void groupChanged();
private:
- QQuickExclusiveGroup *m_group;
+ Q_DISABLE_COPY(QQuickExclusiveAttached)
+ Q_DECLARE_PRIVATE(QQuickExclusiveAttached)
};
QT_END_NAMESPACE