diff options
author | Kevin Smith <git@kismith.co.uk> | 2010-05-26 21:24:39 (GMT) |
---|---|---|
committer | Kevin Smith <git@kismith.co.uk> | 2010-05-26 21:24:39 (GMT) |
commit | 8d697d9aa2f07a3222dea561174f063c382449f1 (patch) | |
tree | 5206c4927231f608d1ed50609fa5a361b1fa7b77 /Swift/QtUI/QtElidingLabel.h | |
parent | d65ae35e1e14c15c5ae9106e37254b163307934d (diff) | |
download | swift-contrib-8d697d9aa2f07a3222dea561174f063c382449f1.zip swift-contrib-8d697d9aa2f07a3222dea561174f063c382449f1.tar.bz2 |
Make better use of the elided text labels.
Cache the elided text to avoid recalculating and making the QLabel
superclass recalculate everything. Also using plaintext with a font
instead of richtext means that it doesn't have to deal with truncated
html tags.
Hopefully
Resolves: #398
Diffstat (limited to 'Swift/QtUI/QtElidingLabel.h')
-rw-r--r-- | Swift/QtUI/QtElidingLabel.h | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Swift/QtUI/QtElidingLabel.h b/Swift/QtUI/QtElidingLabel.h index 589d6f6..79701ec 100644 --- a/Swift/QtUI/QtElidingLabel.h +++ b/Swift/QtUI/QtElidingLabel.h @@ -14,10 +14,14 @@ namespace Swift { public: QtElidingLabel(QWidget* parent = NULL, Qt::WindowFlags f = 0); QtElidingLabel(const QString &text, QWidget* parent = NULL, Qt::WindowFlags f = 0); + void setText(const QString& text); virtual ~QtElidingLabel(); virtual void paintEvent(QPaintEvent* event); private: void setSizes(); + bool dirty_; + QString fullText_; + QRect lastRect_; }; } |