DAWorkbench 0.0.1
DAWorkbench API
载入中...
搜索中...
未找到
DADataManagerTreeFilterProxyModel.h
1#ifndef DADATAMANAGERTREEFILTERPROXYMODEL_H
2#define DADATAMANAGERTREEFILTERPROXYMODEL_H
3#include <QSortFilterProxyModel>
4#include "DAGuiAPI.h"
5namespace DA
6{
10class DAGUI_API DADataManagerTreeFilterProxyModel : public QSortFilterProxyModel
11{
12 Q_OBJECT
13public:
14 DADataManagerTreeFilterProxyModel(QObject* par = nullptr);
15 // 设置过滤文本
16 void setFilterText(const QString& text);
17 Qt::ItemFlags flags(const QModelIndex& index) const override;
18 QMimeData* mimeData(const QModelIndexList& indexes) const override;
19
20
21protected:
22 bool filterAcceptsRow(int source_row, const QModelIndex& source_parent) const override;
23 bool filterAcceptsRowItself(int source_row, const QModelIndex& source_parent) const;
24 bool hasAcceptedChildren(int source_row, const QModelIndex& source_parent) const;
25
26private:
27 QString m_filterText;
28};
29} // end DA
30#endif // DADATAMANAGERTREEFILTERPROXYMODEL_H
代理模型用于过滤
Definition DADataManagerTreeFilterProxyModel.h:11
序列化类都是带异常的,使用中需要处理异常
Definition AppMainWindow.cpp:44