From aa0cdc4493c0f0435a64cfa8cee010c7659dc8fa Mon Sep 17 00:00:00 2001 From: Arno Date: Thu, 10 Nov 2016 18:10:30 +0100 Subject: Add Random file browser Idea: Select random movies based on a selection of genres and actors in a new tab, so you don't have the agony of choice. This is just the basic layout. The selectors are filled and the buttons are connected, but it doesn't select anything yet. --- randomtab.h | 53 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 randomtab.h (limited to 'randomtab.h') diff --git a/randomtab.h b/randomtab.h new file mode 100644 index 0000000..f8d2218 --- /dev/null +++ b/randomtab.h @@ -0,0 +1,53 @@ +/* + This program is free software; you can redistribute it and/or + modify it under the terms of the GNU General Public License + as published by the Free Software Foundation; either version + 2 of the License, or (at your option) any later version. +*/ + +#ifndef RANDOMTAB_H +#define RANDOMTAB_H + +#include +#include + +class QComboBox; +class QPushButton; +class QTreeView; +class QSortFilterProxyModel; +class QStandardItemModel; +class QLineEdit; + +class RandomTab : public QWidget { + Q_OBJECT + public: + enum CustomRoles { IdRole = Qt::UserRole + 1 }; + explicit RandomTab(QWidget *parent = 0); + + public slots: + void setupModels(); + void clearAll(); + void refreshComboboxes(); + void select(); + + private: + void setupGui(); + QComboBox *mGenre1; + QComboBox *mGenre2; + QComboBox *mGenre3; + QComboBox *mActor1; + QComboBox *mActor2; + QComboBox *mActor3; + QLineEdit *mNumber; + QPushButton *mSelect; + QPushButton *mClear; + QPushButton *mRefresh; + QTreeView *mFileView; + QStandardItemModel *mFileModel; + QStandardItemModel *mGenreModel; + QStandardItemModel *mActorModel; + QSortFilterProxyModel *mFileProxy; + QSqlDatabase mDb; +}; + +#endif // RANDOMTAB_H -- cgit v1.2.3-70-g09d2