summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp')
-rw-r--r--Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp
index e399885..9ecc8e0 100644
--- a/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp
+++ b/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp
@@ -39,7 +39,7 @@ void QtVCardOrganizationField::setupContentWidgets() {
unitsTreeWidget = new QTreeWidget(this);
unitsTreeWidget->setColumnCount(2);
unitsTreeWidget->header()->setStretchLastSection(false);
- int closeIconWidth = unitsTreeWidget->fontMetrics().height();
+ int closeIconWidth = style()->pixelMetric(QStyle::PM_TabCloseIndicatorWidth, 0, 0);
unitsTreeWidget->header()->resizeSection(1, closeIconWidth);
#if QT_VERSION >= 0x050000
@@ -76,6 +76,10 @@ void QtVCardOrganizationField::setOrganization(const VCard::Organization& organi
item->setFlags(item->flags() | Qt::ItemIsEditable);
unitsTreeWidget->addTopLevelItem(item);
}
+
+ QTreeWidgetItem* item = new QTreeWidgetItem(QStringList("") << "");
+ item->setFlags(item->flags() | Qt::ItemIsEditable);
+ unitsTreeWidget->addTopLevelItem(item);
}
VCard::Organization QtVCardOrganizationField::getOrganization() const {
@@ -88,10 +92,6 @@ VCard::Organization QtVCardOrganizationField::getOrganization() const {
}
}
- QTreeWidgetItem* item = new QTreeWidgetItem(QStringList("") << "");
- item->setFlags(item->flags() | Qt::ItemIsEditable);
- unitsTreeWidget->addTopLevelItem(item);
-
return organization;
}