1
0
mirror of https://gitee.com/drabel/LibQQt.git synced 2025-01-04 10:18:44 +08:00
LibQQt/qqttreemodel.h
tianduanrui 3f857669fc init
2016-12-29 16:49:18 +08:00

46 lines
1.3 KiB
C++
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef QQTTREEMODEL_H
#define QQTTREEMODEL_H
#include <QStandardItemModel>
#include "qqtfilesystem.h"
class QQTTreeModel : public QStandardItemModel
{
Q_OBJECT
public:
explicit QQTTreeModel(QObject *parent, QQTFileSystem* fs);
//从查询结果中过滤出rootpath里面的内容进行保存
void setRootPath();
//过滤,排序
inline void setNameFilter(QString filter)
{ m_fs->setNameFilter(filter); }
inline void setFilter(QDir::Filters filter = QDir::Dirs | QDir::Files | QDir::NoSymLinks | QDir::NoDotAndDotDot)
{ m_fs->setFilter(filter); }
inline void setSorting(QDir::SortFlags sort = QDir::DirsFirst | QDir::Name)
{ m_fs->setSorting(sort); }
bool query(QString path);
bool removeRow(int arow, const QModelIndex &aparent);
QList<QStandardItem*> findItems(const QString &text,
Qt::MatchFlags flags = Qt::MatchExactly,
int column = 0) const;
QList<QStandardItem *> findItems(const QModelIndex& parent, const QString &text,
Qt::MatchFlags flags = Qt::MatchExactly,
int column = 0) const;
signals:
public slots:
private slots:
void result();
private:
QQTFileSystem* m_fs;
QString m_path;
};
#endif // QQTTREEMODEL_H