From bd4a19963e102f4a89fdc1f17349909605324519 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Wed, 10 Sep 2014 08:31:35 +0200 Subject: Respect contents margins when calculating the size hint MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Without this part of the calendar widget get cut off when put in a layout and the contentsMargins are non zero. Task-number: QTBUG-40352 Change-Id: I9ce90476c59c270d92e876a5dc81ea8ce325848c Reviewed-by: Lars Knoll Reviewed-by: Shawn Rutledge Reviewed-by: Jan Arve Sæther --- src/widgets/widgets/qcalendarwidget.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/widgets/widgets') diff --git a/src/widgets/widgets/qcalendarwidget.cpp b/src/widgets/widgets/qcalendarwidget.cpp index d6704c20d2..fa3dbc1f32 100644 --- a/src/widgets/widgets/qcalendarwidget.cpp +++ b/src/widgets/widgets/qcalendarwidget.cpp @@ -2247,6 +2247,9 @@ QSize QCalendarWidget::minimumSizeHint() const w *= cols; w = qMax(headerSize.width(), w); h = (h * rows) + headerSize.height(); + QMargins cm = contentsMargins(); + w += cm.left() + cm.right(); + h += cm.top() + cm.bottom(); d->cachedSizeHint = QSize(w, h); return d->cachedSizeHint; } -- cgit v1.2.3