diff options
Diffstat (limited to 'Swift/QtUI/QtVCardWidget/QtResizableLineEdit.cpp')
-rw-r--r-- | Swift/QtUI/QtVCardWidget/QtResizableLineEdit.cpp | 42 |
1 files changed, 21 insertions, 21 deletions
diff --git a/Swift/QtUI/QtVCardWidget/QtResizableLineEdit.cpp b/Swift/QtUI/QtVCardWidget/QtResizableLineEdit.cpp index f60f9a8..9eef970 100644 --- a/Swift/QtUI/QtVCardWidget/QtResizableLineEdit.cpp +++ b/Swift/QtUI/QtVCardWidget/QtResizableLineEdit.cpp @@ -5,54 +5,54 @@ */ /* - * Copyright (c) 2014 Isode Limited. + * Copyright (c) 2014-2016 Isode Limited. * All rights reserved. * See the COPYING file for more information. */ -#include "QtResizableLineEdit.h" +#include <Swift/QtUI/QtVCardWidget/QtResizableLineEdit.h> namespace Swift { QtResizableLineEdit::QtResizableLineEdit(QWidget* parent) : - QLineEdit(parent), editable(false) { - connect(this, SIGNAL(textChanged(QString)), SLOT(textChanged(QString))); - setMinimumWidth(30); + QLineEdit(parent), editable(false) { + connect(this, SIGNAL(textChanged(QString)), SLOT(textChanged(QString))); + setMinimumWidth(30); } QtResizableLineEdit::~QtResizableLineEdit() { } bool QtResizableLineEdit::isEditable() const { - return editable; + return editable; } void QtResizableLineEdit::setEditable(const bool editable) { - this->editable = editable; - if (editable) { - setReadOnly(false); - } else { - setReadOnly(true); - } + this->editable = editable; + if (editable) { + setReadOnly(false); + } else { + setReadOnly(true); + } } QSize QtResizableLineEdit::sizeHint() const { - int horizontalMargin = 10; - int verticalMargin = 6; - QSize textDimensions; + int horizontalMargin = 10; + int verticalMargin = 6; + QSize textDimensions; #if QT_VERSION >= 0x040700 - textDimensions = fontMetrics().boundingRect(text().isEmpty() ? placeholderText() : text()).size(); + textDimensions = fontMetrics().boundingRect(text().isEmpty() ? placeholderText() : text()).size(); #else - textDimensions = fontMetrics().boundingRect(text().isEmpty() ? QString(" ") : text()).size(); + textDimensions = fontMetrics().boundingRect(text().isEmpty() ? QString(" ") : text()).size(); #endif - textDimensions.setWidth(textDimensions.width() + horizontalMargin); - textDimensions.setHeight(textDimensions.height() + verticalMargin); - return textDimensions; + textDimensions.setWidth(textDimensions.width() + horizontalMargin); + textDimensions.setHeight(textDimensions.height() + verticalMargin); + return textDimensions; } void QtResizableLineEdit::textChanged(QString) { - updateGeometry(); + updateGeometry(); } } |