blob: b2f0c3b75679988e66f4e67dd81d67b7737cc60c (
plain)
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
|
#ifndef STOREMODEL_H_
#define STOREMODEL_H_
#include "util.h"
#include <QSortFilterProxyModel>
/*!
\class StoreModel
\brief The QSortFilterProxyModel for handling filesystem searches.
*/
class QFileSystemModel;
class StoreModel : public QSortFilterProxyModel {
Q_OBJECT
private:
QFileSystemModel *fs;
QString store;
public:
StoreModel();
bool filterAcceptsRow(int, const QModelIndex &) const override;
bool ShowThis(const QModelIndex) const;
void setModelAndStore(QFileSystemModel *sourceModel, QString passStore);
QVariant data(const QModelIndex &index, int role) const override;
bool lessThan(const QModelIndex &source_left,
const QModelIndex &source_right) const override;
// QAbstractItemModel interface
public:
Qt::DropActions supportedDropActions() const override;
Qt::DropActions supportedDragActions() const override;
Qt::ItemFlags flags(const QModelIndex &index) const override;
QStringList mimeTypes() const override;
QMimeData *mimeData(const QModelIndexList &indexes) const override;
bool canDropMimeData(const QMimeData *data, Qt::DropAction action, int row,
int column, const QModelIndex &parent) const override;
bool dropMimeData(const QMimeData *data, Qt::DropAction action, int row,
int column, const QModelIndex &parent) override;
};
/*!
\struct dragAndDropInfo
\brief holds values to share beetween drag and drop on the passwordstorage
view
*/
struct dragAndDropInfoPasswordStore {
bool isDir;
bool isFile;
QString path;
};
#endif // STOREMODEL_H_
|