diff options
author | Marc Mutz <marc.mutz@kdab.com> | 2020-05-05 15:28:46 +0200 |
---|---|---|
committer | Marc Mutz <marc.mutz@kdab.com> | 2020-05-07 21:06:02 +0200 |
commit | 2f8cfc2c608159bfbe6e085c37bd76bbaa5bd607 (patch) | |
tree | 59f4ae608e1fe8864ccd055f788bc2c94463fa27 /src/widgets/graphicsview/qgraphicsanchorlayout.cpp | |
parent | fc65683e65191ed03ecd96a22a491c81c0717003 (diff) |
QGraphicsAnchorLayout: port to QHVContainer [1/4]: local QHVContainer
This part of the patch changes the definitons of the member variables
from 'C arrays of extent 2' to QHVContainer and fixes the code where
ints were used to index into the array.
To not drown in renames, keep the locally-defined enum 'Orientation',
and create a local version of QHVContainer whose index operator is
overloaded for both Qt::Orientation and the local 'Orientation'.
Follow-up patches will remove these, then, completely.
After this patch, NOrientations is no longer used, and consequently
removed.
Change-Id: I2a241520fce4beeb87fc0e26cd6ab18f324a956a
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
Diffstat (limited to 'src/widgets/graphicsview/qgraphicsanchorlayout.cpp')
-rw-r--r-- | src/widgets/graphicsview/qgraphicsanchorlayout.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/widgets/graphicsview/qgraphicsanchorlayout.cpp b/src/widgets/graphicsview/qgraphicsanchorlayout.cpp index 4f1855a606..b7c83e32a0 100644 --- a/src/widgets/graphicsview/qgraphicsanchorlayout.cpp +++ b/src/widgets/graphicsview/qgraphicsanchorlayout.cpp @@ -238,8 +238,8 @@ QGraphicsAnchorLayout::~QGraphicsAnchorLayout() d->removeCenterConstraints(this, QGraphicsAnchorLayoutPrivate::Vertical); d->deleteLayoutEdges(); - Q_ASSERT(d->itemCenterConstraints[0].isEmpty()); - Q_ASSERT(d->itemCenterConstraints[1].isEmpty()); + Q_ASSERT(d->itemCenterConstraints[Qt::Horizontal].isEmpty()); + Q_ASSERT(d->itemCenterConstraints[Qt::Vertical].isEmpty()); Q_ASSERT(d->items.isEmpty()); Q_ASSERT(d->m_vertexList.isEmpty()); } @@ -372,7 +372,7 @@ void QGraphicsAnchorLayout::setHorizontalSpacing(qreal spacing) { Q_D(QGraphicsAnchorLayout); - d->spacings[0] = spacing; + d->spacings[Qt::Horizontal] = spacing; invalidate(); } @@ -385,7 +385,7 @@ void QGraphicsAnchorLayout::setVerticalSpacing(qreal spacing) { Q_D(QGraphicsAnchorLayout); - d->spacings[1] = spacing; + d->spacings[Qt::Vertical] = spacing; invalidate(); } @@ -404,7 +404,7 @@ void QGraphicsAnchorLayout::setSpacing(qreal spacing) { Q_D(QGraphicsAnchorLayout); - d->spacings[0] = d->spacings[1] = spacing; + d->spacings = {spacing, spacing}; invalidate(); } |