#pragma once #include #include #include class QgsMapCanvas; class QgsMapToolPan; class QgsLayerTreeModel; class QgsLayerTreeView; class QgsLayerTreeMapCanvasBridge; class QDockWidget; class QLabel; class QStatusBar; class QMenuBar; class QToolBar; class QgsMapLayer; class ManualLabelToolWidget : public QMainWindow { Q_OBJECT public: ManualLabelToolWidget(QWidget *parent = nullptr); ~ManualLabelToolWidget(); private: // UI void init_UI();// Init UI private: // 组件 QgsMapCanvas* map_canvas=nullptr; // map widget QgsMapToolPan* map_tool_pan = nullptr; // map tool for pan zoom QgsLayerTreeModel* map_layerModel = nullptr; QgsLayerTreeView* map_layerTreeView = nullptr; QgsLayerTreeMapCanvasBridge* map_layer_Bridge = nullptr; private: // 布局 QDockWidget* layerTreeDock; // 状态栏 QLabel* scaleLabel; // 比例尺 QLabel* CoordinaryTextLabel; // 图层坐标系 QLabel* PointXYLabel;// 鼠标指针坐标 QLabel* UnitLabel; QStatusBar* appStatusBar;// 状态控制栏 private: // 菜单栏 QMenuBar* menubar; private: // 绘制图层 QToolBar* AiLabelToolBar; private: // 文件菜单 QMenu* fileMenu; QAction* newAction; QMenu* openMenu; QAction* openRasterFolderAction; QAction* openRasterAction; QAction* openSLCRasterAction; private:// 编辑菜单 QMenu* editMenu; public slots:// 功能函数区 void open(); void openRasterLayerTriggered(); void openRaster(QString &path); public slots: // 状态栏函数 void updateScaleLabel(double); void updateCoordinateLabel(const QgsPointXY&); void onMapExtentsChanged(); void onLayersChanged(QgsMapLayer* layer); public: // 常用变量区 QString lastFileDialogPath; };