summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKevin Smith <git@kismith.co.uk>2010-04-16 15:09:23 (GMT)
committerKevin Smith <git@kismith.co.uk>2010-04-16 15:09:23 (GMT)
commite51448532f837d3ac28ea3c9b03f711df1940803 (patch)
treead8582a7a311384002e16e706dcc376c50fd7e2d /Swift/QtUI/EventViewer/TwoLineDelegate.h
parent1e42aa0003876f5416f723d535ca27e7b2f6dc68 (diff)
downloadswift-e51448532f837d3ac28ea3c9b03f711df1940803.zip
swift-e51448532f837d3ac28ea3c9b03f711df1940803.tar.bz2
Slighly better rendering for the Event view.
Diffstat (limited to 'Swift/QtUI/EventViewer/TwoLineDelegate.h')
-rw-r--r--Swift/QtUI/EventViewer/TwoLineDelegate.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/Swift/QtUI/EventViewer/TwoLineDelegate.h b/Swift/QtUI/EventViewer/TwoLineDelegate.h
new file mode 100644
index 0000000..15a4476
--- /dev/null
+++ b/Swift/QtUI/EventViewer/TwoLineDelegate.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2010 Kevin Smith
+ * Licensed under the GNU General Public License v3.
+ * See Documentation/Licenses/GPLv3.txt for more information.
+ */
+
+#pragma once
+
+#include <QStyledItemDelegate>
+
+#include "Swift/QtUI/Roster/DelegateCommons.h"
+#include "QtEvent.h"
+
+namespace Swift {
+ class TwoLineDelegate {
+ public:
+ TwoLineDelegate(int firstRole, int secondRole, bool wrap);
+ ~TwoLineDelegate();
+ QSize sizeHint(const QStyleOptionViewItem& option, QtEvent* event) const;
+ void paint(QPainter* painter, const QStyleOptionViewItem& option, QtEvent* event) const;
+ private:
+ DelegateCommons common_;
+ int firstRole_;
+ int secondRole_;
+ bool wrap_;
+ };
+
+}
+