17 bool AddNode(
const QString& szName,
int parentId);
18 bool AddFavorite(
const QString &szFile,
19 const QString& szName,
21 const QString szDescription,
24 const QString &szFile,
const QString &szName = QString(),
25 const QString &szDescription = QString(),
const QIcon &icon = QIcon());
30 RoleFile = Qt::UserRole,
36 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex())
const override;
37 QModelIndex parent(
const QModelIndex &index)
const override;
39 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
40 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
43 bool canFetchMore(
const QModelIndex &parent)
const override;
44 void fetchMore(
const QModelIndex &parent)
override;
46 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
49 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole)
override;
51 Qt::ItemFlags flags(
const QModelIndex &index)
const override;
54 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex())
override;
61 tree* parent =
nullptr;
62 QVector<tree*> children;
70 bool IsFolder()
const;
71 bool IsFavorite()
const;
72 int ChildCount()
const;
73 tree* ChildAt(
int index)
const;
74 int GetInserIndex(
tree* child);
75 bool AddChild(
tree* child);
76 bool InsertChild(
int index,
tree* child);
77 bool RemoveChild(
tree* child);
78 tree* FindChild(
int id)
const;
79 tree* FindRecursive(
int id)
const;
87 QMap<int, tree*> m_Folders;
88 tree* GetTree(
int id)
const;
90 tree* GetTree(QModelIndex index)
const;
91 QModelIndex CreateIndex(
tree* t)
const;
93 void ClearTree(
tree* node);
95 bool UpdateTree(
const QString &szFile);
96 bool MoveTree(
int id,
int newParentId);