summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2015-05-31 18:14:49 (GMT)
committerTobias Markmann <tm@ayena.de>2015-05-31 18:14:49 (GMT)
commit44f48755200c7185fcae53e9e944e3a50e8806a5 (patch)
treeb5e6b5cfd8a5f8246e5b303c8aa68612f2bfc62b /Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp
parent5b851c72510ef88feb059455033915588fa6fb8c (diff)
downloadswift-44f48755200c7185fcae53e9e944e3a50e8806a5.zip
swift-44f48755200c7185fcae53e9e944e3a50e8806a5.tar.bz2
Remove magic number and fix QtVCardWidget::sizeHint
This adds layout margin and spacing to the calculation of the correct size hint. Test-Information: Tested on OS X 10.9.5 with Qt 5.4.1. Change-Id: I7036f64a6621f5ce6603e77da26a887e28c663ca
Diffstat (limited to 'Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp b/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp
index e202de5..79360d8 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtVCardWidget.cpp
@@ -84,6 +84,12 @@ QSize QtVCardWidget::sizeHint() const {
newSizeHint = QSize(std::max(newSizeHint.width(), fieldsWidgetSize.width()), newSizeHint.height() + fieldsWidgetSize.height());
+ // add layout margin
+ newSizeHint += QSize(layout()->contentsMargins().left() + layout()->contentsMargins().right(), layout()->contentsMargins().top() + layout()->contentsMargins().bottom());
+
+ // the spaceing before and after the line between the profile header and its fields
+ newSizeHint += QSize(0, layout()->spacing() * 2);
+
return newSizeHint;
}