diff options
Diffstat (limited to 'Swift/QtUI/QtVCardWidget')
5 files changed, 14 insertions, 4 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtVCardAddressField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardAddressField.cpp index 4d34e53..d9bb4fe 100644 --- a/Swift/QtUI/QtVCardWidget/QtVCardAddressField.cpp +++ b/Swift/QtUI/QtVCardWidget/QtVCardAddressField.cpp @@ -156,7 +156,7 @@ void QtVCardAddressField::handleEditibleChanged(bool isEditable) { foreach (QWidget* widget, textFields) { QtResizableLineEdit* lineEdit; if ((lineEdit = dynamic_cast<QtResizableLineEdit*>(widget))) { - lineEdit->setShown(isEditable ? true : !lineEdit->text().isEmpty()); + lineEdit->setVisible(isEditable ? true : !lineEdit->text().isEmpty()); lineEdit->setStyleSheet(isEditable ? "" : "QLineEdit { border: none; background: transparent; }"); } } diff --git a/Swift/QtUI/QtVCardWidget/QtVCardInternetEMailField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardInternetEMailField.cpp index 46f253f..b946fc4 100644 --- a/Swift/QtUI/QtVCardWidget/QtVCardInternetEMailField.cpp +++ b/Swift/QtUI/QtVCardWidget/QtVCardInternetEMailField.cpp @@ -12,6 +12,7 @@ #include <Swiften/Base/Log.h> #include <Swift/QtUI/QtSwiftUtil.h> +#include <Swift/QtUI/QtUtilities.h> namespace Swift { @@ -71,7 +72,7 @@ void QtVCardInternetEMailField::handleEditibleChanged(bool isEditable) { } else { if (emailLineEdit) emailLineEdit->hide(); if (emailLabel) { - emailLabel->setText(QString("<a href=\"mailto:%1\">%1</a>").arg(Qt::escape(emailLineEdit->text()))); + emailLabel->setText(QString("<a href=\"mailto:%1\">%1</a>").arg(QtUtilities::htmlEscape(emailLineEdit->text()))); emailLabel->show(); } } diff --git a/Swift/QtUI/QtVCardWidget/QtVCardJIDField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardJIDField.cpp index dbb4b7c..ecb5533 100644 --- a/Swift/QtUI/QtVCardWidget/QtVCardJIDField.cpp +++ b/Swift/QtUI/QtVCardWidget/QtVCardJIDField.cpp @@ -11,6 +11,7 @@ #include <boost/algorithm/string.hpp> #include <Swift/QtUI/QtSwiftUtil.h> +#include <Swift/QtUI/QtUtilities.h> namespace Swift { @@ -62,7 +63,7 @@ void QtVCardJIDField::handleEditibleChanged(bool isEditable) { } else { if (jidLineEdit) jidLineEdit->hide(); if (jidLabel) { - jidLabel->setText(QString("<a href=\"xmpp:%1\">%1</a>").arg(Qt::escape(jidLineEdit->text()))); + jidLabel->setText(QString("<a href=\"xmpp:%1\">%1</a>").arg(QtUtilities::htmlEscape(jidLineEdit->text()))); jidLabel->show(); } } diff --git a/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp index 5f231dc..e399885 100644 --- a/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp +++ b/Swift/QtUI/QtVCardWidget/QtVCardOrganizationField.cpp @@ -41,7 +41,13 @@ void QtVCardOrganizationField::setupContentWidgets() { unitsTreeWidget->header()->setStretchLastSection(false); int closeIconWidth = unitsTreeWidget->fontMetrics().height(); unitsTreeWidget->header()->resizeSection(1, closeIconWidth); + +#if QT_VERSION >= 0x050000 + unitsTreeWidget->header()->setSectionResizeMode(0, QHeaderView::Stretch); +#else unitsTreeWidget->header()->setResizeMode(0, QHeaderView::Stretch); +#endif + unitsTreeWidget->setHeaderHidden(true); unitsTreeWidget->setRootIsDecorated(false); unitsTreeWidget->setEditTriggers(QAbstractItemView::DoubleClicked); diff --git a/Swift/QtUI/QtVCardWidget/QtVCardURLField.cpp b/Swift/QtUI/QtVCardWidget/QtVCardURLField.cpp index 0b6f0c1..35cc4ce 100644 --- a/Swift/QtUI/QtVCardWidget/QtVCardURLField.cpp +++ b/Swift/QtUI/QtVCardWidget/QtVCardURLField.cpp @@ -12,6 +12,8 @@ #include <boost/algorithm/string.hpp> #include <Swift/QtUI/QtSwiftUtil.h> +#include <Swift/QtUI/QtUtilities.h> + namespace Swift { @@ -59,7 +61,7 @@ void QtVCardURLField::handleEditibleChanged(bool isEditable) { } else { if (urlLineEdit) urlLineEdit->hide(); if (urlLabel) { - urlLabel->setText(QString("<a href=\"%1\">%1</a>").arg(Qt::escape(urlLineEdit->text()))); + urlLabel->setText(QString("<a href=\"%1\">%1</a>").arg(QtUtilities::htmlEscape(urlLineEdit->text()))); urlLabel->show(); } } |