summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'Swift/QtUI/Roster/QtTreeWidgetFactory.h')
-rw-r--r--Swift/QtUI/Roster/QtTreeWidgetFactory.h42
1 files changed, 42 insertions, 0 deletions
diff --git a/Swift/QtUI/Roster/QtTreeWidgetFactory.h b/Swift/QtUI/Roster/QtTreeWidgetFactory.h
new file mode 100644
index 0000000..2ca1e21
--- /dev/null
+++ b/Swift/QtUI/Roster/QtTreeWidgetFactory.h
@@ -0,0 +1,42 @@
+#ifndef SWIFT_QtTreeWidgetFactory_H
+#define SWIFT_QtTreeWidgetFactory_H
+
+#include "Swiften/Roster/TreeWidgetFactory.h"
+#include "Swiften/Roster/TreeWidget.h"
+#include "Swiften/Roster/TreeWidgetItem.h"
+#include "Swift/QtUI/Roster/QtTreeWidgetItem.h"
+#include "Swift/QtUI/Roster/QtTreeWidget.h"
+
+namespace Swift {
+
+class QtTreeWidgetFactory : public TreeWidgetFactory {
+ public:
+ QtTreeWidgetFactory() {
+ }
+
+ TreeWidget* createTreeWidget() {
+ return new QtTreeWidget();
+ }
+
+ TreeWidgetItem* createTreeWidgetItem(TreeWidgetItem* item) {
+ QtTreeWidgetItem* qtItem = dynamic_cast<QtTreeWidgetItem*>(item);
+ assert(qtItem);
+ QtTreeWidgetItem* newItem = new QtTreeWidgetItem(qtItem);
+ qtItem->addChild(newItem);
+ return newItem;
+ }
+
+ TreeWidgetItem* createTreeWidgetItem(TreeWidget* item) {
+ QtTreeWidget* treeItem = dynamic_cast<QtTreeWidget*>(item);
+ assert(treeItem);
+ QtTreeWidgetItem* qtItem = treeItem->getRoot();
+ QtTreeWidgetItem* newItem = new QtTreeWidgetItem(qtItem);
+ //qtItem->setItemWidget(newItem, 0, newItem->getCollapsedRosterWidget());
+ qtItem->addChild(newItem);
+ return newItem;
+ }
+};
+
+}
+#endif
+