更新代码
parent
de770a3610
commit
5054dbf699
|
|
@ -662,3 +662,5 @@ cython_debug/
|
||||||
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
|
||||||
#.idea/
|
#.idea/
|
||||||
|
|
||||||
|
**/**/x64
|
||||||
|
**/**/.vs
|
||||||
|
|
@ -0,0 +1,123 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{89CAC2D1-AF91-42BC-BDE1-2BC8C490CE7A}</ProjectGuid>
|
||||||
|
<Keyword>QtVS_v304</Keyword>
|
||||||
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
|
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||||
|
<QtInstall>qgis_qt5</QtInstall>
|
||||||
|
<QtModules>core;gui;widgets</QtModules>
|
||||||
|
<QtBuildConfig>debug</QtBuildConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||||
|
<QtInstall>tools_qt5</QtInstall>
|
||||||
|
<QtModules>core;xml;gui;widgets</QtModules>
|
||||||
|
<QtBuildConfig>release</QtBuildConfig>
|
||||||
|
<QtPlugin>true</QtPlugin>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||||
|
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||||
|
</Target>
|
||||||
|
<ImportGroup Label="ExtensionSettings" />
|
||||||
|
<ImportGroup Label="Shared" />
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<IncludePath>D:\OSGeo4W\apps\qgis-dev\include;D:\OSGeo4W\include;$(IncludePath)</IncludePath>
|
||||||
|
<ReferencePath>D:\OSGeo4W\lib;D:\OSGeo4W\apps\qgis-dev\lib;$(ReferencePath)</ReferencePath>
|
||||||
|
<LibraryPath>D:\OSGeo4W\lib;D:\OSGeo4W\apps\qgis-dev\lib;$(LibraryPath)</LibraryPath>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||||
|
<Link>
|
||||||
|
<AdditionalDependencies>qgis_core.lib;qgis_app.lib;qgis_gui.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||||
|
</Link>
|
||||||
|
<ClCompile>
|
||||||
|
<PreprocessorDefinitions>_USE_MATH_DEFINES;_SILENCE_STDEXT_ARR_ITERS_DEPRECATION_WARNING;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||||
|
<LanguageStandard>stdcpp17</LanguageStandard>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="RasterOperator.cpp" />
|
||||||
|
<QtRcc Include="ManualLabelToolWidget.qrc" />
|
||||||
|
<QtMoc Include="ManualLabelToolWidget.h" />
|
||||||
|
<ClCompile Include="ManualLabelToolWidget.cpp" />
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="RasterOperator.h" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,49 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Form Files">
|
||||||
|
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||||
|
<Extensions>ui</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Translation Files">
|
||||||
|
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||||
|
<Extensions>ts</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtRcc Include="ManualLabelToolWidget.qrc">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</QtRcc>
|
||||||
|
<QtMoc Include="ManualLabelToolWidget.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<ClCompile Include="ManualLabelToolWidget.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="RasterOperator.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClInclude Include="RasterOperator.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,276 @@
|
||||||
|
#include "ManualLabelToolWidget.h"
|
||||||
|
#include <qdockwidget.h>
|
||||||
|
#include <qgslayertreeview.h>
|
||||||
|
#include <qgslayertreemodel.h>
|
||||||
|
#include <qgslayertreemapcanvasbridge.h>
|
||||||
|
#include <qgslayertreeview.h>
|
||||||
|
#include <qgslayertreemapcanvasbridge.h>
|
||||||
|
#include <qlabel.h>
|
||||||
|
#include <qstatusbar.h>
|
||||||
|
#include <QMenuBar>
|
||||||
|
#include <QToolBar>
|
||||||
|
#include <qgsmapcanvas.h>
|
||||||
|
#include <qgsrasterlayer.h>
|
||||||
|
#include <qgsmaptoolpan.h>
|
||||||
|
#include <qgsunittypes.h>
|
||||||
|
#include <QString>
|
||||||
|
#include <qgis.h>
|
||||||
|
#include <QgsMapSettings.h>
|
||||||
|
#include <QFile>
|
||||||
|
#include <QFileDialog>
|
||||||
|
#include <QDialog>
|
||||||
|
#include <QString>
|
||||||
|
#include <qfileinfo.h>
|
||||||
|
#include <qdir.h>
|
||||||
|
#include <qgsmaplayer.h>
|
||||||
|
#include <qgsproject.h>
|
||||||
|
//QgsUnitTypes
|
||||||
|
|
||||||
|
// 定义访问参数
|
||||||
|
#define RASTERFILEFILTER u8"所有文件 (*.*);;TIF (*.tif);;TIFF (*.tiff);;bin (*.bin);;dat (*.dat);;"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
ManualLabelToolWidget::ManualLabelToolWidget(QWidget *parent)
|
||||||
|
: QMainWindow(parent)
|
||||||
|
{
|
||||||
|
this->init_UI();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
ManualLabelToolWidget::~ManualLabelToolWidget()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void ManualLabelToolWidget::init_UI()
|
||||||
|
{
|
||||||
|
this->setWindowTitle(tr(u8"AI标注软件"));
|
||||||
|
// 初始大小
|
||||||
|
{
|
||||||
|
this->resize(1920,1080);
|
||||||
|
}
|
||||||
|
|
||||||
|
//地图控制
|
||||||
|
{
|
||||||
|
// 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);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 状态工具栏
|
||||||
|
{
|
||||||
|
appStatusBar = this->statusBar(); // 获取或创建状态栏
|
||||||
|
|
||||||
|
scaleLabel = new QLabel(tr(u8"比例尺:"));
|
||||||
|
CoordinaryTextLabel = new QLabel(tr(u8"坐标系:"));
|
||||||
|
PointXYLabel = new QLabel(tr(u8"坐标:"));
|
||||||
|
UnitLabel = new QLabel(tr(u8"单位:"));
|
||||||
|
appStatusBar->addPermanentWidget(PointXYLabel); //
|
||||||
|
appStatusBar->addPermanentWidget(scaleLabel); //
|
||||||
|
appStatusBar->addPermanentWidget(UnitLabel); //
|
||||||
|
appStatusBar->addPermanentWidget(CoordinaryTextLabel); //
|
||||||
|
|
||||||
|
// 连接比例尺变化信号
|
||||||
|
connect(map_canvas, SIGNAL(scaleChanged(double)) , this, SLOT(updateScaleLabel(double)));
|
||||||
|
connect(map_canvas, SIGNAL(xyCoordinates(const QgsPointXY&)), this, SLOT(updateCoordinateLabel(const QgsPointXY&)));
|
||||||
|
|
||||||
|
connect(map_canvas, SIGNAL(extentsChanged()), this, SLOT(onMapExtentsChanged()));
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// 菜单栏
|
||||||
|
{
|
||||||
|
menubar = this->menuBar();
|
||||||
|
|
||||||
|
// 在菜单栏上添加"文件"和"编辑"菜单
|
||||||
|
fileMenu = menubar->addMenu(tr(u8"文件"));
|
||||||
|
|
||||||
|
|
||||||
|
// 向"文件"菜单中添加菜单项(QAction)
|
||||||
|
newAction = fileMenu->addAction(tr(u8"新建"));
|
||||||
|
fileMenu->addSeparator(); // 添加分割线[1,5](@ref)
|
||||||
|
openMenu = fileMenu->addMenu(tr(u8"打开"));
|
||||||
|
|
||||||
|
openRasterFolderAction = openMenu->addAction(tr(u8"打开影像文件夹"));
|
||||||
|
openRasterAction = openMenu->addAction(tr(u8"打开影像"));
|
||||||
|
openSLCRasterAction = openMenu->addAction(tr(u8"SLC影像"));
|
||||||
|
editMenu = menubar->addMenu(tr(u8"编辑"));
|
||||||
|
|
||||||
|
// 事件绑定
|
||||||
|
QObject::connect(this->openRasterAction, SIGNAL(triggered()), this, SLOT(openRasterLayerTriggered()));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
// AI标注工具栏
|
||||||
|
{
|
||||||
|
AiLabelToolBar = new QToolBar(tr(u8"AI标注工具栏"), this);
|
||||||
|
this->addToolBar(Qt::LeftToolBarArea, AiLabelToolBar);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ManualLabelToolWidget::open()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ManualLabelToolWidget::openRasterLayerTriggered()
|
||||||
|
{
|
||||||
|
if (lastFileDialogPath.isEmpty()) {
|
||||||
|
lastFileDialogPath = ".";
|
||||||
|
}
|
||||||
|
// 打开影像
|
||||||
|
// 2. 选择多个文件
|
||||||
|
QString rasterPath = QFileDialog::getOpenFileName(
|
||||||
|
this,
|
||||||
|
tr(u8"请选择影像文件"),
|
||||||
|
lastFileDialogPath,
|
||||||
|
tr(RASTERFILEFILTER)
|
||||||
|
);
|
||||||
|
|
||||||
|
lastFileDialogPath = rasterPath;
|
||||||
|
// 读取数据
|
||||||
|
this->openRaster(rasterPath);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ManualLabelToolWidget::openRaster(QString& filePath)
|
||||||
|
{
|
||||||
|
QString filename = QFileInfo(filePath).fileName();
|
||||||
|
|
||||||
|
QgsRasterLayer* rasterLayer = new QgsRasterLayer(filePath, filename);
|
||||||
|
if (!rasterLayer->isValid()) {
|
||||||
|
qDebug() << "Failed to load raster layer!";
|
||||||
|
// 错误处理
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
QgsProject::instance()->addMapLayer(rasterLayer);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ManualLabelToolWidget::updateCoordinateLabel(const QgsPointXY& point)
|
||||||
|
{
|
||||||
|
QString coordText = QString(tr(u8"坐标:X:%1 Y:%2")).arg(QString::number(point.x(), 'f', 2)).arg(QString::number(point.y(), 'f', 2));
|
||||||
|
PointXYLabel->setText(coordText);
|
||||||
|
}
|
||||||
|
|
||||||
|
void ManualLabelToolWidget::onMapExtentsChanged()
|
||||||
|
{
|
||||||
|
QgsRectangle currentExtent = map_canvas->extent();
|
||||||
|
|
||||||
|
//// 现在你可以使用这个范围信息了,例如:
|
||||||
|
//// 1. 打印范围坐标
|
||||||
|
//qDebug() << "新范围 - Xmin:" << currentExtent.xMinimum()
|
||||||
|
// << "Ymin:" << currentExtent.yMinimum()
|
||||||
|
// << "Xmax:" << currentExtent.xMaximum()
|
||||||
|
// << "Ymax:" << currentExtent.yMaximum();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ManualLabelToolWidget::onLayersChanged(QgsMapLayer* layer)
|
||||||
|
{
|
||||||
|
|
||||||
|
// WGS坐标系
|
||||||
|
QgsCoordinateReferenceSystem currentCrs = map_canvas->mapSettings().destinationCrs();
|
||||||
|
// 获取坐标系的描述信息和认证标识符,例如 "WGS 84 / EPSG:4326"
|
||||||
|
QString description = currentCrs.description();
|
||||||
|
QString authid = currentCrs.authid();
|
||||||
|
|
||||||
|
|
||||||
|
// 获取当前项目中所有图层
|
||||||
|
QList<QgsMapLayer*> layers = QgsProject::instance()->mapLayers().values();
|
||||||
|
int layerCount = layers.size();
|
||||||
|
|
||||||
|
// 判断当前是否仅有一层
|
||||||
|
if (layerCount == 0&&description == "") {
|
||||||
|
QgsMapLayer* theOnlyLayer = layers.first();
|
||||||
|
|
||||||
|
// 检查图层是否有效且拥有定义的坐标系
|
||||||
|
if (theOnlyLayer && theOnlyLayer->isValid() && theOnlyLayer->crs().isValid()) {
|
||||||
|
// 将地图画布的目标坐标系设置为与图层一致
|
||||||
|
map_canvas->mapSettings().setDestinationCrs(theOnlyLayer->crs());
|
||||||
|
// 可选:将地图范围缩放至该图层的全范围,提供更好的初始视图
|
||||||
|
map_canvas->setExtent(theOnlyLayer->extent());
|
||||||
|
// 刷新画布,使更改生效
|
||||||
|
map_canvas->refresh();
|
||||||
|
qDebug() << "图层数量为1,已同步画布坐标系至:" << theOnlyLayer->crs().description();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void ManualLabelToolWidget::updateScaleLabel(double scale)
|
||||||
|
{
|
||||||
|
// 将比例尺数值格式化为易读的字符串,例如 1:10000
|
||||||
|
QString scaleText = QString(tr(u8"比例尺:1:%1")).arg(QString::number(scale, 'f', 0));
|
||||||
|
scaleLabel->setText(scaleText);
|
||||||
|
|
||||||
|
// 同时更新单位标签
|
||||||
|
Qgis::DistanceUnit unit = map_canvas->mapUnits();
|
||||||
|
QString unitString;
|
||||||
|
if (unit == Qgis::DistanceUnit::Meters) {
|
||||||
|
unitString = tr(u8"米");
|
||||||
|
}
|
||||||
|
else if (unit == Qgis::DistanceUnit::Degrees) {
|
||||||
|
unitString = tr(u8"度");
|
||||||
|
}
|
||||||
|
else if (unit == Qgis::DistanceUnit::Feet) {
|
||||||
|
unitString = tr(u8"英尺");
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
unitString = tr(u8"未知");
|
||||||
|
}
|
||||||
|
UnitLabel->setText(QString(tr(u8"单位:%1")).arg(unitString));
|
||||||
|
|
||||||
|
// WGS坐标系
|
||||||
|
QgsCoordinateReferenceSystem currentCrs = map_canvas->mapSettings().destinationCrs();
|
||||||
|
// 获取坐标系的描述信息和认证标识符,例如 "WGS 84 / EPSG:4326"
|
||||||
|
QString description = currentCrs.description();
|
||||||
|
QString authid = currentCrs.authid();
|
||||||
|
|
||||||
|
if (description == "") {
|
||||||
|
// 假设 ui->label_crs 是用于显示坐标系信息的QLabel
|
||||||
|
CoordinaryTextLabel->setText(QString(tr(u8"坐标系:未知")));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
// 假设 ui->label_crs 是用于显示坐标系信息的QLabel
|
||||||
|
CoordinaryTextLabel->setText(QString(tr(u8"坐标系:%1 (%2)")).arg(description).arg(authid));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,86 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QtWidgets/QMainWindow>
|
||||||
|
#include <memory>
|
||||||
|
#include <qgspointxy.h>
|
||||||
|
|
||||||
|
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;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
};
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="ManualLabelToolWidget">
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
#include "RasterOperator.h"
|
||||||
|
|
@ -0,0 +1,5 @@
|
||||||
|
#pragma once
|
||||||
|
class RasterOperator
|
||||||
|
{
|
||||||
|
};
|
||||||
|
|
||||||
|
|
@ -0,0 +1,27 @@
|
||||||
|
//#include "ManualLabelToolWidget.h"
|
||||||
|
//#include <QtWidgets/QApplication>
|
||||||
|
//
|
||||||
|
//int main(int argc, char *argv[])
|
||||||
|
//{
|
||||||
|
// QApplication app(argc, argv);
|
||||||
|
// ManualLabelToolWidget window;
|
||||||
|
// window.show();
|
||||||
|
// return app.exec();
|
||||||
|
//}
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QmainWindow>
|
||||||
|
|
||||||
|
#include <qgsmapcanvas.h>
|
||||||
|
#include <qgsrasterlayer.h>
|
||||||
|
#include <qgsmaptoolpan.h>
|
||||||
|
#include "ManualLabelToolWidget.h"
|
||||||
|
//整数类型主函数(整数类型统计参数个数,字符类型指针数组指向字符串参数)
|
||||||
|
int main(int argc, char** argv)
|
||||||
|
{
|
||||||
|
//QApplication有且仅有一个应用程序类的对象
|
||||||
|
QApplication app(argc, argv);
|
||||||
|
ManualLabelToolWidget labeltoolwidget;
|
||||||
|
labeltoolwidget.show();
|
||||||
|
//等待用户操作
|
||||||
|
return app.exec();
|
||||||
|
}
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,31 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.13.35825.156 d17.13
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Manual-Labeling-Client", "Manual-Labeling-Client.vcxproj", "{2F3ECF9F-10C1-4D1D-BB73-38D7C3835F73}"
|
||||||
|
EndProject
|
||||||
|
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "Manual-Label-Tool-Widget", "..\Manual-Label-Tool-Widget\Manual-Label-Tool-Widget.vcxproj", "{89CAC2D1-AF91-42BC-BDE1-2BC8C490CE7A}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|x64 = Debug|x64
|
||||||
|
Release|x64 = Release|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{2F3ECF9F-10C1-4D1D-BB73-38D7C3835F73}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{2F3ECF9F-10C1-4D1D-BB73-38D7C3835F73}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{2F3ECF9F-10C1-4D1D-BB73-38D7C3835F73}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{2F3ECF9F-10C1-4D1D-BB73-38D7C3835F73}.Release|x64.Build.0 = Release|x64
|
||||||
|
{89CAC2D1-AF91-42BC-BDE1-2BC8C490CE7A}.Debug|x64.ActiveCfg = Debug|x64
|
||||||
|
{89CAC2D1-AF91-42BC-BDE1-2BC8C490CE7A}.Debug|x64.Build.0 = Debug|x64
|
||||||
|
{89CAC2D1-AF91-42BC-BDE1-2BC8C490CE7A}.Release|x64.ActiveCfg = Release|x64
|
||||||
|
{89CAC2D1-AF91-42BC-BDE1-2BC8C490CE7A}.Release|x64.Build.0 = Release|x64
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {47BDF617-39C7-4200-BDD6-E88A9224CB56}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
||||||
|
|
@ -0,0 +1,122 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project DefaultTargets="Build" ToolsVersion="17.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup Label="ProjectConfigurations">
|
||||||
|
<ProjectConfiguration Include="Debug|x64">
|
||||||
|
<Configuration>Debug</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
<ProjectConfiguration Include="Release|x64">
|
||||||
|
<Configuration>Release</Configuration>
|
||||||
|
<Platform>x64</Platform>
|
||||||
|
</ProjectConfiguration>
|
||||||
|
</ItemGroup>
|
||||||
|
<PropertyGroup Label="Globals">
|
||||||
|
<ProjectGuid>{2F3ECF9F-10C1-4D1D-BB73-38D7C3835F73}</ProjectGuid>
|
||||||
|
<Keyword>QtVS_v304</Keyword>
|
||||||
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
|
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0</WindowsTargetPlatformVersion>
|
||||||
|
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseDebugLibraries>true</UseDebugLibraries>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ConfigurationType>Application</ConfigurationType>
|
||||||
|
<PlatformToolset>v143</PlatformToolset>
|
||||||
|
<UseDebugLibraries>false</UseDebugLibraries>
|
||||||
|
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||||
|
<CharacterSet>Unicode</CharacterSet>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||||
|
<QtInstall>qgis_qt5</QtInstall>
|
||||||
|
<QtModules>core;gui;widgets</QtModules>
|
||||||
|
<QtBuildConfig>debug</QtBuildConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||||
|
<QtInstall>tools_qt5</QtInstall>
|
||||||
|
<QtModules>core;gui;widgets</QtModules>
|
||||||
|
<QtBuildConfig>release</QtBuildConfig>
|
||||||
|
</PropertyGroup>
|
||||||
|
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||||
|
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||||
|
</Target>
|
||||||
|
<ImportGroup Label="ExtensionSettings" />
|
||||||
|
<ImportGroup Label="Shared" />
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||||
|
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||||
|
</ImportGroup>
|
||||||
|
<PropertyGroup Label="UserMacros" />
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||||
|
</Link>
|
||||||
|
<QtMoc>
|
||||||
|
<PrependInclude>stdafx.h;%(PrependInclude)</PrependInclude>
|
||||||
|
</QtMoc>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||||
|
<ClCompile>
|
||||||
|
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||||
|
<PrecompiledHeader>Use</PrecompiledHeader>
|
||||||
|
<PrecompiledHeaderFile>stdafx.h</PrecompiledHeaderFile>
|
||||||
|
<WarningLevel>Level3</WarningLevel>
|
||||||
|
<SDLCheck>true</SDLCheck>
|
||||||
|
<ConformanceMode>true</ConformanceMode>
|
||||||
|
<FunctionLevelLinking>true</FunctionLevelLinking>
|
||||||
|
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||||
|
</ClCompile>
|
||||||
|
<Link>
|
||||||
|
<SubSystem>Windows</SubSystem>
|
||||||
|
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||||
|
<EnableCOMDATFolding>true</EnableCOMDATFolding>
|
||||||
|
<OptimizeReferences>true</OptimizeReferences>
|
||||||
|
</Link>
|
||||||
|
<QtMoc>
|
||||||
|
<PrependInclude>stdafx.h;%(PrependInclude)</PrependInclude>
|
||||||
|
</QtMoc>
|
||||||
|
</ItemDefinitionGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtRcc Include="ManualLabelingClient.qrc" />
|
||||||
|
<QtUic Include="ManualLabelingClient.ui" />
|
||||||
|
<QtMoc Include="ManualLabelingClient.h" />
|
||||||
|
<ClCompile Include="ManualLabelingClient.cpp" />
|
||||||
|
<ClCompile Include="main.cpp" />
|
||||||
|
<ClInclude Include="stdafx.h" />
|
||||||
|
<ClCompile Include="stdafx.cpp">
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">Create</PrecompiledHeader>
|
||||||
|
<PrecompiledHeader Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">Create</PrecompiledHeader>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||||
|
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||||
|
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||||
|
</ImportGroup>
|
||||||
|
<ImportGroup Label="ExtensionTargets">
|
||||||
|
</ImportGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,50 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<ItemGroup>
|
||||||
|
<Filter Include="Source Files">
|
||||||
|
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||||
|
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Header Files">
|
||||||
|
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||||
|
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Resource Files">
|
||||||
|
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||||
|
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Form Files">
|
||||||
|
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||||
|
<Extensions>ui</Extensions>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="Translation Files">
|
||||||
|
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||||
|
<Extensions>ts</Extensions>
|
||||||
|
</Filter>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<QtRcc Include="ManualLabelingClient.qrc">
|
||||||
|
<Filter>Resource Files</Filter>
|
||||||
|
</QtRcc>
|
||||||
|
<QtUic Include="ManualLabelingClient.ui">
|
||||||
|
<Filter>Form Files</Filter>
|
||||||
|
</QtUic>
|
||||||
|
<QtMoc Include="ManualLabelingClient.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</QtMoc>
|
||||||
|
<ClCompile Include="ManualLabelingClient.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClInclude Include="stdafx.h">
|
||||||
|
<Filter>Header Files</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClCompile Include="stdafx.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<ClCompile Include="main.cpp">
|
||||||
|
<Filter>Source Files</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
</ItemGroup>
|
||||||
|
</Project>
|
||||||
|
|
@ -0,0 +1,12 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "ManualLabelingClient.h"
|
||||||
|
|
||||||
|
ManualLabelingClient::ManualLabelingClient(QWidget *parent)
|
||||||
|
: QMainWindow(parent)
|
||||||
|
{
|
||||||
|
ui.setupUi(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
ManualLabelingClient::~ManualLabelingClient()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,17 @@
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <QtWidgets/QMainWindow>
|
||||||
|
#include "ui_ManualLabelingClient.h"
|
||||||
|
|
||||||
|
class ManualLabelingClient : public QMainWindow
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
|
||||||
|
public:
|
||||||
|
ManualLabelingClient(QWidget *parent = nullptr);
|
||||||
|
~ManualLabelingClient();
|
||||||
|
|
||||||
|
private:
|
||||||
|
Ui::ManualLabelingClientClass ui;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
||||||
|
<RCC>
|
||||||
|
<qresource prefix="ManualLabelingClient">
|
||||||
|
</qresource>
|
||||||
|
</RCC>
|
||||||
|
|
@ -0,0 +1,29 @@
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<UI version="4.0" >
|
||||||
|
<class>ManualLabelingClientClass</class>
|
||||||
|
<widget class="QMainWindow" name="ManualLabelingClientClass" >
|
||||||
|
<property name="objectName" >
|
||||||
|
<string notr="true">ManualLabelingClientClass</string>
|
||||||
|
</property>
|
||||||
|
<property name="geometry" >
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>600</width>
|
||||||
|
<height>400</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle" >
|
||||||
|
<string>ManualLabelingClient</string>
|
||||||
|
</property> <widget class="QMenuBar" name="menuBar" />
|
||||||
|
<widget class="QToolBar" name="mainToolBar" />
|
||||||
|
<widget class="QWidget" name="centralWidget" />
|
||||||
|
<widget class="QStatusBar" name="statusBar" />
|
||||||
|
</widget>
|
||||||
|
<layoutDefault spacing="6" margin="11" />
|
||||||
|
<pixmapfunction></pixmapfunction>
|
||||||
|
<resources>
|
||||||
|
<include location="ManualLabelingClient.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</UI>
|
||||||
|
|
@ -0,0 +1,11 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
#include "ManualLabelingClient.h"
|
||||||
|
#include <QtWidgets/QApplication>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
QApplication app(argc, argv);
|
||||||
|
ManualLabelingClient window;
|
||||||
|
window.show();
|
||||||
|
return app.exec();
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
#include "stdafx.h"
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
#include <QtWidgets>
|
||||||
Loading…
Reference in New Issue