diff options
author | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2018-09-24 12:50:42 +0200 |
---|---|---|
committer | Maurice Kalinowski <maurice.kalinowski@qt.io> | 2018-09-24 11:01:41 +0000 |
commit | 880c4ce36aa5f2effc2385aac44648637709df54 (patch) | |
tree | 20b571c0335a36ef5b71be214e6434cceed9bffe | |
parent | c3f94e1370f39bb0f2789e1ab9923005d24061f9 (diff) |
Fix usage of size constraints for QChartView
The calculation for the minimum size needs to take into account the
included graphics view as well as the scroll area. The scroll area is
the place where users specify size constraints. Those should not be
overwritten internally.
Task-number: QTBUG-69133
Change-Id: I737c47166303a91e16c4c680992f7490bbe18f17
Reviewed-by: Miikka Heikkinen <miikka.heikkinen@qt.io>
-rw-r--r-- | src/charts/qchartview.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/charts/qchartview.cpp b/src/charts/qchartview.cpp index 540a91e0..280e96d4 100644 --- a/src/charts/qchartview.cpp +++ b/src/charts/qchartview.cpp @@ -331,7 +331,8 @@ void QChartViewPrivate::resize() } m_chart->resize(chartSize); - q_ptr->setMinimumSize(m_chart->minimumSize().toSize()); + q_ptr->setMinimumSize(m_chart->minimumSize().toSize().expandedTo(q_ptr->minimumSize())); + q_ptr->setMaximumSize(q_ptr->maximumSize().boundedTo(m_chart->maximumSize().toSize())); q_ptr->setSceneRect(m_chart->geometry()); } |