summaryrefslogtreecommitdiffstats
path: root/src/widgets/widgets/qcalendarwidget.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-09-10 08:31:35 +0200
committerJan Arve Sæther <jan-arve.saether@theqtcompany.com>2014-10-22 07:23:37 +0200
commitbd4a19963e102f4a89fdc1f17349909605324519 (patch)
tree249beba226d24b1d40d44499a72e3fc9a051f949 /src/widgets/widgets/qcalendarwidget.cpp
parentc5bc66df2fd976f4e055c579f6918138d3accd87 (diff)
Respect contents margins when calculating the size hint
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 <lars.knoll@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
Diffstat (limited to 'src/widgets/widgets/qcalendarwidget.cpp')
-rw-r--r--src/widgets/widgets/qcalendarwidget.cpp3
1 files changed, 3 insertions, 0 deletions
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;
}