diff options
author | Remko Tronçon <git@el-tramo.be> | 2013-03-04 13:23:10 (GMT) |
---|---|---|
committer | Remko Tronçon <git@el-tramo.be> | 2013-03-04 16:03:53 (GMT) |
commit | ca7a45a25c2fe332fad1ee3f7a2822415c249206 (patch) | |
tree | 268c6d37f087935a307061f9d5ef507ddd5162cf /Swift/QtUI/QtVCardWidget | |
parent | 836925a5cdc7017da7fb84416c803e652b48e399 (diff) | |
download | swift-ca7a45a25c2fe332fad1ee3f7a2822415c249206.zip swift-ca7a45a25c2fe332fad1ee3f7a2822415c249206.tar.bz2 |
Qt5 support & warning fixes.
Change-Id: I62c7d5ca44c915e36c797c798294b7c34b465514
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(); } } |