summaryrefslogtreecommitdiffstats
path: root/src/widgets/graphicsview
diff options
context:
space:
mode:
authorMarc Mutz <marc.mutz@kdab.com>2020-05-05 15:28:46 +0200
committerMarc Mutz <marc.mutz@kdab.com>2020-05-09 00:18:49 +0200
commit6cc72479ac8032dec4f98787f04e173b89fa3410 (patch)
treeffe4e897cf81146bdb306afe56d86ab8a84062b8 /src/widgets/graphicsview
parent204b6c99089bcf7893be326e7d0076402b7abf0c (diff)
QGraphicsAnchorLayout: port to QHVContainer [3/4]: Orientation as alias for Qt::Orientation
There would still be too many renames, so keep the locally-defined names 'Orientation', 'Horizontal', and 'Vertical' as deprecated forwarders to Qt::Orientation, Qt::Horizontal and Qt::Vertical, resp. Follow-up patches will remove these, then, completely. Change-Id: Ifae926a38086027ad8fe4ad07d1d089c03f9508d Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/widgets/graphicsview')
-rw-r--r--src/widgets/graphicsview/qgraphicsanchorlayout_p.h27
1 files changed, 3 insertions, 24 deletions
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
index e945c5d6b6..f82e58873a 100644
--- a/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
+++ b/src/widgets/graphicsview/qgraphicsanchorlayout_p.h
@@ -392,30 +392,9 @@ public:
MaxPreferredToMaximum
};
- // Several structures internal to the layout are duplicated to handle
- // both Horizontal and Vertical restrictions.
- //
- // Orientation is used to reference the right structure in each context
- enum Orientation {
- Horizontal = 0,
- Vertical,
- };
-
- template <typename T>
- class QHVContainer : public QT_PREPEND_NAMESPACE(QHVContainer)<T>
- {
- using Base = QT_PREPEND_NAMESPACE(QHVContainer)<T>;
- static constexpr Qt::Orientation map(Orientation o) noexcept
- { return static_cast<Qt::Orientation>(int(o) + 1); }
- public:
- using Base::Base;
- using Base::operator[];
-
- constexpr const T &operator[](Orientation o) const noexcept
- { return this->operator[](map(o)); }
- constexpr T &operator[](Orientation o) noexcept
- { return this->operator[](map(o)); }
- };
+ typedef Qt::Orientation Orientation [[deprecated]];
+ [[deprecated]] static inline constexpr Qt::Orientation Horizontal = Qt::Horizontal;
+ [[deprecated]] static inline constexpr Qt::Orientation Vertical = Qt::Vertical;
QGraphicsAnchorLayoutPrivate();