-
Notifications
You must be signed in to change notification settings - Fork 0
/
shotwin.h
68 lines (52 loc) · 1.63 KB
/
shotwin.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef SHOTWIN_H
#define SHOTWIN_H
#include <QObject>
#include <QMap>
#include <QString>
#include <QVariant>
class QAbstractItemModel;
class DateFilteredEventModel;
class EventModel;
class EventOrTagFilteredPhotoModel;
class PhotoModel;
class TreeProxyModel;
class TagModel;
class Shotwin : public QObject
{
Q_OBJECT
public:
explicit Shotwin(QObject* parent = nullptr);
bool initModels();
QAbstractItemModel* getEventTree() const;
QAbstractItemModel* getEventList() const;
QAbstractItemModel* getPhotoList() const;
QAbstractItemModel* getPhotoModel() const;
QAbstractItemModel* getTagModel() const;
QAbstractItemModel* getFileSystemModel() const;
QMap<QString, QVariant> getMap() const;
void setMap(const QMap<QString, QVariant>& value);
Q_INVOKABLE QStringList getTagsForPhoto(int id) const;
signals:
void eventListRequested();
void photoListRequested();
void eventSelected(const QModelIndex& index);
void tagSelected(const QModelIndex& index);
public slots:
void selectEvent(const QModelIndex& index);
void openEvent(int index);
void selectTag(const QModelIndex& index);
void selectTagByString(const QString& tag);
void resetFilterAndShowTree();
private:
bool initDbViews();
private:
EventModel* eventModel = nullptr;
PhotoModel* photoModel = nullptr;
EventOrTagFilteredPhotoModel* photoListModel = nullptr;
DateFilteredEventModel* eventListModel = nullptr;
TreeProxyModel* eventTreeModel = nullptr;
TreeProxyModel* fileSystemModel = nullptr;
TagModel* tagModel = nullptr;
QMap<QString, QVariant> map;
};
#endif // SHOTWIN_H