aboutsummaryrefslogtreecommitdiffstats
path: root/src/quicktemplates2/qquickswipeview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/quicktemplates2/qquickswipeview.cpp')
-rw-r--r--src/quicktemplates2/qquickswipeview.cpp25
1 files changed, 6 insertions, 19 deletions
diff --git a/src/quicktemplates2/qquickswipeview.cpp b/src/quicktemplates2/qquickswipeview.cpp
index 0f3b6851..f887be7b 100644
--- a/src/quicktemplates2/qquickswipeview.cpp
+++ b/src/quicktemplates2/qquickswipeview.cpp
@@ -108,13 +108,6 @@ class QQuickSwipeViewPrivate : public QQuickContainerPrivate
Q_DECLARE_PUBLIC(QQuickSwipeView)
public:
- QQuickSwipeViewPrivate()
- : interactive(true),
- orientation(Qt::Horizontal)
- {
- changeTypes |= ImplicitWidth | ImplicitHeight;
- }
-
void resizeItem(QQuickItem *item);
void resizeItems();
@@ -126,8 +119,8 @@ public:
qreal getContentWidth() const override;
qreal getContentHeight() const override;
- bool interactive;
- Qt::Orientation orientation;
+ bool interactive = true;
+ Qt::Orientation orientation = Qt::Horizontal;
};
class QQuickSwipeViewAttachedPrivate : public QObjectPrivate
@@ -135,13 +128,6 @@ class QQuickSwipeViewAttachedPrivate : public QObjectPrivate
Q_DECLARE_PUBLIC(QQuickSwipeViewAttached)
public:
- QQuickSwipeViewAttachedPrivate()
- : swipeView(nullptr),
- index(-1),
- currentIndex(-1)
- {
- }
-
static QQuickSwipeViewAttachedPrivate *get(QQuickSwipeViewAttached *attached)
{
return attached->d_func();
@@ -151,9 +137,9 @@ public:
void updateCurrentIndex();
void setCurrentIndex(int i);
- QQuickSwipeView *swipeView;
- int index;
- int currentIndex;
+ QQuickSwipeView *swipeView = nullptr;
+ int index = -1;
+ int currentIndex = -1;
};
void QQuickSwipeViewPrivate::resizeItems()
@@ -218,6 +204,7 @@ QQuickSwipeView::QQuickSwipeView(QQuickItem *parent)
: QQuickContainer(*(new QQuickSwipeViewPrivate), parent)
{
Q_D(QQuickSwipeView);
+ d->changeTypes |= QQuickItemPrivate::ImplicitWidth | QQuickItemPrivate::ImplicitHeight;
setFlag(ItemIsFocusScope);
setActiveFocusOnTab(true);
QObjectPrivate::connect(this, &QQuickContainer::currentItemChanged, d, &QQuickControlPrivate::updateImplicitContentSize);