diff options
author | q5sys <jt@xsystems.com> | 2018-03-28 22:12:14 -0400 |
---|---|---|
committer | q5sys <jt@xsystems.com> | 2018-03-28 22:12:14 -0400 |
commit | 56cf5df2352526c40943d560032dfd64a3535fcb (patch) | |
tree | 3f36a0b818a649f9a8278e6c3b883f38704952a5 /src-qt5/desktop-utils/lumina-fm | |
parent | Merge branch 'master' of http://github.com/trueos/lumina (diff) | |
download | lumina-56cf5df2352526c40943d560032dfd64a3535fcb.tar.gz lumina-56cf5df2352526c40943d560032dfd64a3535fcb.tar.bz2 lumina-56cf5df2352526c40943d560032dfd64a3535fcb.zip |
ltreewidget.h
Diffstat (limited to 'src-qt5/desktop-utils/lumina-fm')
-rw-r--r-- | src-qt5/desktop-utils/lumina-fm/widgets/ltreewidget.h | 23 |
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); +} +}; |