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());
29 bool Move(QModelIndex index, QModelIndex parentIndex);
30 bool Copy(QModelIndex index, QModelIndex parentIndex);
32 RoleFile = Qt::UserRole,
38 QModelIndex index(
int row,
int column,
const QModelIndex &parent = QModelIndex())
const override;
39 QModelIndex parent(
const QModelIndex &index)
const override;
41 int rowCount(
const QModelIndex &parent = QModelIndex())
const override;
42 int columnCount(
const QModelIndex &parent = QModelIndex())
const override;
45 bool canFetchMore(
const QModelIndex &parent)
const override;
46 void fetchMore(
const QModelIndex &parent)
override;
48 QVariant data(
const QModelIndex &index,
int role = Qt::DisplayRole)
const override;
51 bool setData(
const QModelIndex &index,
const QVariant &value,
int role = Qt::EditRole)
override;
53 Qt::ItemFlags flags(
const QModelIndex &index)
const override;
56 bool removeRows(
int row,
int count,
const QModelIndex &parent = QModelIndex())
override;
63 tree* parent =
nullptr;
64 QVector<tree*> children;
72 bool IsFolder()
const;
73 bool IsFavorite()
const;
74 int ChildCount()
const;
75 tree* ChildAt(
int index)
const;
76 int GetInserIndex(
tree* child);
77 bool AddChild(
tree* child);
78 bool InsertChild(
int index,
tree* child);
79 bool RemoveChild(
tree* child);
89 QMap<int, tree*> m_Folders;
90 tree* GetTree(
int id)
const;
92 tree* GetTree(QModelIndex index)
const;
93 QModelIndex CreateIndex(
tree* t)
const;
95 void ClearTree(
tree* node);
97 bool UpdateTree(
const QString &szFile);