aboutsummaryrefslogtreecommitdiff
path: root/src-qt5/desktop-utils/lumina-fm
diff options
context:
space:
mode:
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm')
-rw-r--r--src-qt5/desktop-utils/lumina-fm/widgets/ltreewidget.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/src-qt5/desktop-utils/lumina-fm/widgets/ltreewidget.h b/src-qt5/desktop-utils/lumina-fm/widgets/ltreewidget.h
new file mode 100644
index 00000000..7b65d126
--- /dev/null
+++ b/src-qt5/desktop-utils/lumina-fm/widgets/ltreewidget.h
@@ -0,0 +1,23 @@
+class LTreeWidget : public QTreeWidget{
+Q_OBJECT
+
+public:
+
+LTreeWidget(QWidget* parent = 0) : QTreeWidget(parent)
+{
+setSortingEnabled(false); // disbale the default built in sorting
+
+// our sorting method
+header()->setSortIndicatorShown(true);
+header()->setClickable(true);
+connect(header(), SIGNAL(sectionClicked(int)), this, SLOT(customSortByColumn(int)));
+customSortByColumn(header()->sortIndicatorSection());
+}
+
+public slots:
+void customSortByColumn(int column)
+{
+Qt::SortOrder order = header()->sortIndicatorOrder(); // get the order
+sortItems(column, order);
+}
+};
bgstack15