#pragma once
#ifndef WINDLAYERTREEVIEWMENUPROVIDER_H
#define WINDLAYERTREEVIEWMENUPROVIDER_H

#include <QObject>
#include "qgslayertreeview.h"
 // 前置声明
class QgsMapCanvas;

class windLayerTreeViewMenuProvider : public QObject, public QgsLayerTreeViewMenuProvider
{
    Q_OBJECT // 必须的宏，因为继承了QObject

public:
    // 构造函数，传入图层树视图和地图画布，以便菜单操作能与之交互
    windLayerTreeViewMenuProvider(QgsLayerTreeView* view, QgsMapCanvas* canvas, QObject* parent = nullptr);

    // 重写创建上下文菜单的纯虚函数
    QMenu* createContextMenu() override;

private:
    // 私有成员变量，存储传入的视图和画布
    QgsLayerTreeView* mLayerTreeView;
    QgsMapCanvas* mMapCanvas;


private slots: // 
    void showlayerpropertyDialog(bool);
 

};

#endif // WINDLAYERTREEVIEWMENUPROVIDER_H