summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/QtElidingLabel.cpp')
-rw-r--r--Swift/QtUI/QtElidingLabel.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/Swift/QtUI/QtElidingLabel.cpp b/Swift/QtUI/QtElidingLabel.cpp
index 90483f5..f5a39f0 100644
--- a/Swift/QtUI/QtElidingLabel.cpp
+++ b/Swift/QtUI/QtElidingLabel.cpp
@@ -1,13 +1,13 @@
/*
- * Copyright (c) 2010 Isode Limited.
+ * Copyright (c) 2010-2015 Isode Limited.
* All rights reserved.
* See the COPYING file for more information.
*/
-#include "Swift/QtUI/QtElidingLabel.h"
+#include <Swift/QtUI/QtElidingLabel.h>
namespace Swift {
QtElidingLabel::QtElidingLabel(QWidget* parent, Qt::WindowFlags f) : QLabel(parent, f) {
fullText_ = "";
dirty_ = true;
setSizes();
@@ -22,19 +22,24 @@ QtElidingLabel::QtElidingLabel(const QString& text, QWidget* parent, Qt::WindowF
}
QtElidingLabel::~QtElidingLabel() {
}
+QSize QtElidingLabel::sizeHint() const {
+ return sizeHint_;
+}
+
void QtElidingLabel::setSizes() {
setMinimumSize(1, minimumHeight());
}
void QtElidingLabel::setText(const QString& text) {
fullText_ = text;
QLabel::setText(text);
+ sizeHint_ = QLabel::sizeHint();
dirty_ = true;
}
void QtElidingLabel::paintEvent(QPaintEvent* event) {
QRect rect = contentsRect();
dirty_ = dirty_ || rect != lastRect_;