summaryrefslogtreecommitdiffstats
path: root/src/gui/util/qgridlayoutengine_p.h
diff options
context:
space:
mode:
authorMatthias Rauter <matthias.rauter@qt.io>2023-05-04 10:45:19 +0200
committerJan Arve Sæther <jan-arve.saether@qt.io>2023-05-31 11:04:22 +0200
commitb8b34544d0b52b6406567315a2cd4e35ec629c4a (patch)
treed25ec938df9df5e49236e2c9c2604e7651588090 /src/gui/util/qgridlayoutengine_p.h
parent38c8eb8564495b0fe345eaca700966889f1f8aa3 (diff)
Add uniformCellWidths and uniformCellHeights to QGridLayoutEngine
Some users wish to make layouts with uniform column widths or uniform row heights, ignoring the sizeHints of individual items. This patch enables this mode in the QGridLayoutEngine, used by the QuickLayout. The sizeHints are aggregated and their average preferred size and extreme minimum and maximum sizes are respected in the layout. Change-Id: Ibb9409eb0a11a1ce8bb305f44a4cb0071c871ec9 Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
Diffstat (limited to 'src/gui/util/qgridlayoutengine_p.h')
-rw-r--r--src/gui/util/qgridlayoutengine_p.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gui/util/qgridlayoutengine_p.h b/src/gui/util/qgridlayoutengine_p.h
index 8344d488c1..e21d89dd2e 100644
--- a/src/gui/util/qgridlayoutengine_p.h
+++ b/src/gui/util/qgridlayoutengine_p.h
@@ -334,6 +334,12 @@ public:
qreal rowSizeHint(Qt::SizeHint which, int row,
Qt::Orientation orientation = Qt::Vertical) const;
+ bool uniformCellWidths() const;
+ void setUniformCellWidths(bool uniformCellWidths);
+
+ bool uniformCellHeights() const;
+ void setUniformCellHeights(bool uniformCellHeights);
+
void setRowAlignment(int row, Qt::Alignment alignment, Qt::Orientation orientation);
Qt::Alignment rowAlignment(int row, Qt::Orientation orientation) const;
@@ -415,6 +421,8 @@ private:
// Configuration
Qt::Alignment m_defaultAlignment;
unsigned m_snapToPixelGrid : 1;
+ unsigned m_uniformCellWidths : 1;
+ unsigned m_uniformCellHeights : 1;
// Lazily computed from the above user input
mutable QHVContainer<int> q_cachedEffectiveFirstRows;