forked from sanshao27/apktool
-
Notifications
You must be signed in to change notification settings - Fork 0
/
filemodelitem.h
47 lines (33 loc) · 1.06 KB
/
filemodelitem.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
#ifndef MYMODELITEM_H
#define MYMODELITEM_H
#include <QObject>
class FileModelItem :public QObject
{
Q_OBJECT
Q_PROPERTY(QString name READ name CONSTANT)
Q_PROPERTY(QString info READ info CONSTANT)
Q_PROPERTY(bool checked READ checked WRITE setChecked NOTIFY checkedChanged)
public:
FileModelItem(const QString &name, const QString &info, const QString &st = "", const QString &symtarget = "")
:_name(name),_info(info), sortTag(st), _symtarget(symtarget), _checked(false){}
QString name() const{ return _name; }
QString info() const{ return _info; }
QString sym() const { return _symtarget; }
bool checked() const {return _checked; }
QString sortTag;
signals:
void checkedChanged();
public slots:
void setChecked(bool c){
if(_checked != c){
_checked = c;
if(_name == "..")
_checked = false;
emit checkedChanged();
}
}
private:
QString _name, _info, _symtarget;
bool _checked; //_type: true-> file; false->folder
};
#endif // MYMODELITEM_H