diff options
Diffstat (limited to 'src/plugins/General/streambrowser/streamwindow.h')
| -rw-r--r-- | src/plugins/General/streambrowser/streamwindow.h | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/plugins/General/streambrowser/streamwindow.h b/src/plugins/General/streambrowser/streamwindow.h index 35844702d..9e29e81e3 100644 --- a/src/plugins/General/streambrowser/streamwindow.h +++ b/src/plugins/General/streambrowser/streamwindow.h @@ -21,6 +21,7 @@ #define STREAMWINDOW_H #include <QWidget> +#include <QSortFilterProxyModel> #include "ui_streamwindow.h" class QNetworkAccessManager; @@ -28,6 +29,7 @@ class QNetworkReply; class QStandardItemModel; class QSortFilterProxyModel; class QMenu; +class StreamsProxyModel; /** @author Ilya Kotov <forkotov02@hotmail.ru> @@ -64,4 +66,25 @@ private: QMenu *m_favoritesMenu; }; +/** + @author Ilya Kotov <forkotov02@hotmail.ru> +*/ +class StreamsProxyModel: public QSortFilterProxyModel +{ +Q_OBJECT +public: + StreamsProxyModel(QObject *parent) : QSortFilterProxyModel(parent){} + +protected: + bool lessThan (const QModelIndex &left, const QModelIndex &right) const + { + if(left.column() == 2 && right.column() == 2) + { + return sourceModel()->data(left).toInt() < sourceModel()->data(right).toInt(); + } + return QSortFilterProxyModel::lessThan(left, right); + } +}; + + #endif |
