Files
HPPA/HPPA/LayerTree.h
2026-04-02 10:34:57 +08:00

27 lines
804 B
C++
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.

#pragma once
#include "LayerTreeGroupNode.h"
/**
* LayerTree图层树根节点
* - 继承自 LayerTreeGroup本身就是树的根节点
* - 提供可见性级联与父节点三态更新的静态工具
*
* 注意beginInsertRows/endInsertRows 等 Qt Model 变更通知应由 Model 驱动调用,
* LayerTree 只负责维护数据结构正确性。
*/
class LayerTree : public LayerTreeGroup
{
Q_OBJECT
public:
explicit LayerTree(QObject* parent = nullptr);
~LayerTree() override;
LayerTree(const LayerTree&) = delete;
LayerTree& operator=(const LayerTree&) = delete;
// 可见性逻辑(供 Model 调用)
static void setChildrenVisible(LayerTreeNode* n, Qt::CheckState state);
static void updateParentVisibleFromChildren(LayerTreeNode* parent);
};