QTreeView实现多折叠效果
QTreeView实现多折叠效果,又能实时按折叠标题进行分类:
#pragma once
#include <QObject>
#include <QTreeView>
#include <qmutex.h>
#include "QMateriaInfo.h"
#include "ThirdLevlTreeModel.h"
#include "ScalableRectItem.h"
#include <mutex>
enum ThreadState {
ACTIVE = 0,
DELETION_IN_PROGRESS = 1 // 建议使用显式数值赋值
};
/*
单例三层级TreeView
*/
#include <QtGlobal>
#if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
#define CONNECTION_TYPE Qt::ConnectionType::SingleShotConnection
#else
#define CONNECTION_TYPE Qt::UniqueConnection
#endif
class ThirdLevlTreeView : public QTreeView {
Q_OBJECT
public:
enum Columns { COL_CATEGORY = 0, COL_PACKAGE, COL_CODE };
explicit ThirdLevlTreeView(QWidget* parent = nullptr);
~ThirdL