aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickpositioners_p.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/quick/items/qquickpositioners_p.h')
-rw-r--r--src/quick/items/qquickpositioners_p.h79
1 files changed, 20 insertions, 59 deletions
diff --git a/src/quick/items/qquickpositioners_p.h b/src/quick/items/qquickpositioners_p.h
index 2c3aa674c6..02a368882f 100644
--- a/src/quick/items/qquickpositioners_p.h
+++ b/src/quick/items/qquickpositioners_p.h
@@ -1,41 +1,5 @@
-/****************************************************************************
-**
-** Copyright (C) 2016 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the QtQuick module of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 3 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL3 included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 3 requirements
-** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 2.0 or (at your option) the GNU General
-** Public license version 3 or any later version approved by the KDE Free
-** Qt Foundation. The licenses are as published by the Free Software
-** Foundation and appearing in the file LICENSE.GPL2 and LICENSE.GPL3
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-2.0.html and
-** https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
+// Copyright (C) 2016 The Qt Company Ltd.
+// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
#ifndef QQUICKPOSITIONERS_P_H
#define QQUICKPOSITIONERS_P_H
@@ -56,7 +20,9 @@
QT_REQUIRE_CONFIG(quick_positioners);
#include "qquickimplicitsizeitem_p.h"
+#if QT_CONFIG(quick_viewtransitions)
#include "qquickitemviewtransition_p.h"
+#endif
#include <private/qpodvector_p.h>
@@ -74,9 +40,9 @@ class QQuickPositionerAttached : public QObject
public:
QQuickPositionerAttached(QObject *parent);
- Q_PROPERTY(int index READ index NOTIFY indexChanged)
- Q_PROPERTY(bool isFirstItem READ isFirstItem NOTIFY isFirstItemChanged)
- Q_PROPERTY(bool isLastItem READ isLastItem NOTIFY isLastItemChanged)
+ Q_PROPERTY(int index READ index NOTIFY indexChanged FINAL)
+ Q_PROPERTY(bool isFirstItem READ isFirstItem NOTIFY isFirstItemChanged FINAL)
+ Q_PROPERTY(bool isLastItem READ isLastItem NOTIFY isLastItemChanged FINAL)
int index() const { return m_index; }
void setIndex(int index);
@@ -98,14 +64,16 @@ private:
bool m_isLastItem;
};
-class Q_QUICK_PRIVATE_EXPORT QQuickBasePositioner : public QQuickImplicitSizeItem
+class Q_QUICK_EXPORT QQuickBasePositioner : public QQuickImplicitSizeItem
{
Q_OBJECT
Q_PROPERTY(qreal spacing READ spacing WRITE setSpacing NOTIFY spacingChanged)
+#if QT_CONFIG(quick_viewtransitions)
Q_PROPERTY(QQuickTransition *populate READ populate WRITE setPopulate NOTIFY populateChanged)
Q_PROPERTY(QQuickTransition *move READ move WRITE setMove NOTIFY moveChanged)
Q_PROPERTY(QQuickTransition *add READ add WRITE setAdd NOTIFY addChanged)
+#endif
Q_PROPERTY(qreal padding READ padding WRITE setPadding RESET resetPadding NOTIFY paddingChanged REVISION(2, 6))
Q_PROPERTY(qreal topPadding READ topPadding WRITE setTopPadding RESET resetTopPadding NOTIFY topPaddingChanged REVISION(2, 6))
@@ -127,6 +95,7 @@ public:
qreal spacing() const;
void setSpacing(qreal);
+#if QT_CONFIG(quick_viewtransitions)
QQuickTransition *populate() const;
void setPopulate(QQuickTransition *);
@@ -135,6 +104,7 @@ public:
QQuickTransition *add() const;
void setAdd(QQuickTransition *);
+#endif
static QQuickPositionerAttached *qmlAttachedProperties(QObject *obj);
@@ -200,14 +170,18 @@ protected:
void moveTo(const QPointF &pos);
+#if QT_CONFIG(quick_viewtransitions)
void transitionNextReposition(QQuickItemViewTransitioner *transitioner, QQuickItemViewTransitioner::TransitionType type, bool asTarget);
bool prepareTransition(QQuickItemViewTransitioner *transitioner, const QRectF &viewBounds);
void startTransition(QQuickItemViewTransitioner *transitioner);
+#endif
void updatePadding(qreal lp, qreal tp, qreal rp, qreal bp);
QQuickItem *item;
+#if QT_CONFIG(quick_viewtransitions)
QQuickItemViewTransitionableItem *transitionableItem;
+#endif
int index;
bool isNew;
bool isVisible;
@@ -233,7 +207,7 @@ private:
Q_DECLARE_PRIVATE(QQuickBasePositioner)
};
-class Q_AUTOTEST_EXPORT QQuickColumn : public QQuickBasePositioner
+class Q_QUICK_EXPORT QQuickColumn : public QQuickBasePositioner
{
Q_OBJECT
QML_NAMED_ELEMENT(Column)
@@ -244,12 +218,10 @@ public:
protected:
void doPositioning(QSizeF *contentSize) override;
void reportConflictingAnchors() override;
-private:
- Q_DISABLE_COPY(QQuickColumn)
};
class QQuickRowPrivate;
-class Q_AUTOTEST_EXPORT QQuickRow: public QQuickBasePositioner
+class Q_QUICK_EXPORT QQuickRow: public QQuickBasePositioner
{
Q_OBJECT
Q_PROPERTY(Qt::LayoutDirection layoutDirection READ layoutDirection WRITE setLayoutDirection NOTIFY layoutDirectionChanged)
@@ -272,12 +244,11 @@ protected:
void doPositioning(QSizeF *contentSize) override;
void reportConflictingAnchors() override;
private:
- Q_DISABLE_COPY(QQuickRow)
Q_DECLARE_PRIVATE(QQuickRow)
};
class QQuickGridPrivate;
-class Q_AUTOTEST_EXPORT QQuickGrid : public QQuickBasePositioner
+class Q_QUICK_EXPORT QQuickGrid : public QQuickBasePositioner
{
Q_OBJECT
Q_PROPERTY(int rows READ rows WRITE setRows NOTIFY rowsChanged)
@@ -361,12 +332,11 @@ private:
Flow m_flow;
HAlignment m_hItemAlign;
VAlignment m_vItemAlign;
- Q_DISABLE_COPY(QQuickGrid)
Q_DECLARE_PRIVATE(QQuickGrid)
};
class QQuickFlowPrivate;
-class Q_AUTOTEST_EXPORT QQuickFlow: public QQuickBasePositioner
+class Q_QUICK_EXPORT QQuickFlow: public QQuickBasePositioner
{
Q_OBJECT
Q_PROPERTY(Flow flow READ flow WRITE setFlow NOTIFY flowChanged)
@@ -397,18 +367,9 @@ protected:
protected:
QQuickFlow(QQuickFlowPrivate &dd, QQuickItem *parent);
private:
- Q_DISABLE_COPY(QQuickFlow)
Q_DECLARE_PRIVATE(QQuickFlow)
};
-
QT_END_NAMESPACE
-QML_DECLARE_TYPE(QQuickColumn)
-QML_DECLARE_TYPE(QQuickRow)
-QML_DECLARE_TYPE(QQuickGrid)
-QML_DECLARE_TYPE(QQuickFlow)
-
-QML_DECLARE_TYPE(QQuickBasePositioner)
-
#endif // QQUICKPOSITIONERS_P_H