界面初始化
commit
8ae281429d
|
|
@ -664,3 +664,8 @@ cython_debug/
|
|||
|
||||
**/**/x64
|
||||
**/**/.vs
|
||||
*.vcxproj
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -105,15 +105,21 @@
|
|||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<<<<<<< HEAD
|
||||
<ClCompile Include="RasterOperator.cpp" />
|
||||
=======
|
||||
>>>>>>> bc199244a3370d5bb7d3f52d5c17e6e2c467f20a
|
||||
<QtRcc Include="ManualLabelToolWidget.qrc" />
|
||||
<QtMoc Include="ManualLabelToolWidget.h" />
|
||||
<ClCompile Include="ManualLabelToolWidget.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
</ItemGroup>
|
||||
<<<<<<< HEAD
|
||||
<ItemGroup>
|
||||
<ClInclude Include="RasterOperator.h" />
|
||||
</ItemGroup>
|
||||
=======
|
||||
>>>>>>> bc199244a3370d5bb7d3f52d5c17e6e2c467f20a
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@
|
|||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<<<<<<< HEAD
|
||||
<ClCompile Include="RasterOperator.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
|
@ -45,5 +46,7 @@
|
|||
<ClInclude Include="RasterOperator.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
=======
|
||||
>>>>>>> bc199244a3370d5bb7d3f52d5c17e6e2c467f20a
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
|
|
@ -3,6 +3,7 @@
|
|||
#include <qgslayertreeview.h>
|
||||
#include <qgslayertreemodel.h>
|
||||
#include <qgslayertreemapcanvasbridge.h>
|
||||
<<<<<<< HEAD
|
||||
#include <qgslayertreeview.h>
|
||||
#include <qgslayertreemapcanvasbridge.h>
|
||||
#include <qlabel.h>
|
||||
|
|
@ -30,6 +31,8 @@
|
|||
#define RASTERFILEFILTER u8"所有文件 (*.*);;TIF (*.tif);;TIFF (*.tiff);;bin (*.bin);;dat (*.dat);;"
|
||||
|
||||
|
||||
=======
|
||||
>>>>>>> bc199244a3370d5bb7d3f52d5c17e6e2c467f20a
|
||||
|
||||
ManualLabelToolWidget::ManualLabelToolWidget(QWidget *parent)
|
||||
: QMainWindow(parent)
|
||||
|
|
@ -44,6 +47,7 @@ ManualLabelToolWidget::~ManualLabelToolWidget()
|
|||
|
||||
void ManualLabelToolWidget::init_UI()
|
||||
{
|
||||
<<<<<<< HEAD
|
||||
this->setWindowTitle(tr(u8"AI标注软件"));
|
||||
// 初始大小
|
||||
{
|
||||
|
|
@ -274,3 +278,49 @@ void ManualLabelToolWidget::updateScaleLabel(double scale)
|
|||
|
||||
|
||||
}
|
||||
=======
|
||||
// 1. inti map canvas
|
||||
this->map_canvas = new QgsMapCanvas();
|
||||
this->setCentralWidget((this->map_canvas));
|
||||
|
||||
// 2. map tool pan
|
||||
this->map_tool_pan = new QgsMapToolPan(this->map_canvas);
|
||||
this->map_canvas->setMapTool(this->map_tool_pan);
|
||||
|
||||
// 3. map layer manager
|
||||
this->map_layerTreeView =new QgsLayerTreeView(this);
|
||||
// 4. create map model
|
||||
this->map_layerModel = new QgsLayerTreeModel(QgsProject::instance()->layerTreeRoot(), this);
|
||||
this->map_layerModel->setFlag(QgsLayerTreeModel::AllowNodeRename); // 允许重命名
|
||||
this->map_layerModel->setFlag(QgsLayerTreeModel::AllowNodeReorder); // 允许调整顺序
|
||||
this->map_layerModel->setFlag(QgsLayerTreeModel::AllowNodeChangeVisibility); // 允许改变可见性
|
||||
this->map_layerModel->setFlag(QgsLayerTreeModel::ShowLegendAsTree); // 以树状图显示图例
|
||||
this->map_layerModel->setAutoCollapseLegendNodes(10); // 自动折叠过多图例项
|
||||
|
||||
this->map_layerTreeView->setModel(this->map_layerModel);
|
||||
// create bridge between mapcontrol and layer
|
||||
this->map_layer_Bridge = new QgsLayerTreeMapCanvasBridge(QgsProject::instance()->layerTreeRoot(), this->map_canvas, this);
|
||||
|
||||
|
||||
// layer 布局
|
||||
// 1. 创建一个QDockWidget(停靠窗口)来承载图层树视图
|
||||
this->layerTreeDock =new QDockWidget(tr(u8"图层管理器"), this);
|
||||
this->layerTreeDock->setWidget(this->map_layerTreeView);
|
||||
|
||||
// 2. 将已有的图层树视图(m_layerTreeView)设置为这个停靠窗口的中心部件
|
||||
layerTreeDock->setWidget(this->map_layerTreeView);
|
||||
|
||||
// 3. (可选但推荐)设置停靠窗口允许停靠的区域
|
||||
layerTreeDock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea);
|
||||
|
||||
|
||||
|
||||
// 5. 将停靠窗口添加到主窗口的左侧区域
|
||||
this->addDockWidget(Qt::LeftDockWidgetArea, this->layerTreeDock);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
>>>>>>> bc199244a3370d5bb7d3f52d5c17e6e2c467f20a
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtWidgets/QMainWindow>
|
||||
<<<<<<< HEAD
|
||||
#include <memory>
|
||||
#include <qgspointxy.h>
|
||||
|
||||
|
|
@ -16,6 +17,14 @@ class QMenuBar;
|
|||
class QToolBar;
|
||||
class QgsMapLayer;
|
||||
|
||||
=======
|
||||
#include <qgsmapcanvas.h>
|
||||
#include <qgsrasterlayer.h>
|
||||
#include <qgsmaptoolpan.h>
|
||||
#include <memory>
|
||||
#include <qgslayertreeview.h>
|
||||
#include <qgslayertreemapcanvasbridge.h>
|
||||
>>>>>>> bc199244a3370d5bb7d3f52d5c17e6e2c467f20a
|
||||
|
||||
class ManualLabelToolWidget : public QMainWindow
|
||||
{
|
||||
|
|
@ -25,6 +34,11 @@ public:
|
|||
ManualLabelToolWidget(QWidget *parent = nullptr);
|
||||
~ManualLabelToolWidget();
|
||||
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
|
||||
|
||||
>>>>>>> bc199244a3370d5bb7d3f52d5c17e6e2c467f20a
|
||||
private: // UI
|
||||
void init_UI();// Init UI
|
||||
|
||||
|
|
@ -38,6 +52,7 @@ private: //
|
|||
|
||||
private: // 꼈애
|
||||
QDockWidget* layerTreeDock;
|
||||
<<<<<<< HEAD
|
||||
|
||||
// 榴檄으
|
||||
QLabel* scaleLabel; // 궐절넹
|
||||
|
|
@ -80,6 +95,8 @@ public: //
|
|||
|
||||
|
||||
|
||||
=======
|
||||
>>>>>>> bc199244a3370d5bb7d3f52d5c17e6e2c467f20a
|
||||
|
||||
|
||||
};
|
||||
|
|
|
|||
Loading…
Reference in New Issue