From 6cc72479ac8032dec4f98787f04e173b89fa3410 Mon Sep 17 00:00:00 2001 From: Marc Mutz Date: Tue, 5 May 2020 15:28:46 +0200 Subject: [PATCH] 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 --- .../graphicsview/qgraphicsanchorlayout_p.h | 27 +++---------------- 1 file 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 - class QHVContainer : public QT_PREPEND_NAMESPACE(QHVContainer) - { - using Base = QT_PREPEND_NAMESPACE(QHVContainer); - static constexpr Qt::Orientation map(Orientation o) noexcept - { return static_cast(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();