summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-05-24 15:49:03 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-05-24 15:49:03 (GMT)
commit10534d5b942e7ef1e2f8e6900fb5b17411111b06 (patch)
treedad1d97e518614150b38a4f7a1e262228b732bff /Swift/QtUI/QtElidingLabel.h
parentc85da0a6e0448b07c51ae07e41a6714429510b83 (diff)
downloadswift-10534d5b942e7ef1e2f8e6900fb5b17411111b06.zip
swift-10534d5b942e7ef1e2f8e6900fb5b17411111b06.tar.bz2
Elide text in the roster header when it's wider than the roster.
Resolves: #369
Diffstat (limited to 'Swift/QtUI/QtElidingLabel.h')
-rw-r--r--Swift/QtUI/QtElidingLabel.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/Swift/QtUI/QtElidingLabel.h b/Swift/QtUI/QtElidingLabel.h
new file mode 100644
index 0000000..589d6f6
--- /dev/null
+++ b/Swift/QtUI/QtElidingLabel.h
@@ -0,0 +1,23 @@
+/*
+ * Copyright (c) 2010 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <QLabel>
+
+namespace Swift {
+ class QtElidingLabel : public QLabel {
+ Q_OBJECT
+ public:
+ QtElidingLabel(QWidget* parent = NULL, Qt::WindowFlags f = 0);
+ QtElidingLabel(const QString &text, QWidget* parent = NULL, Qt::WindowFlags f = 0);
+ virtual ~QtElidingLabel();
+
+ virtual void paintEvent(QPaintEvent* event);
+ private:
+ void setSizes();
+ };
+}