Skip to content

Commit cde294e

Browse files
committed
UI improvements
1 parent 1b0bd51 commit cde294e

7 files changed

+46
-9
lines changed

src/analysis/vector/geometry_checker/qgsgeometrycheckfactory.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,8 @@
1616
#include "qgsgeometrycheckfactory.h"
1717

1818
#include "qgis.h"
19+
20+
QgsGeometryCheck::CheckType QgsGeometryCheckFactory::flags() const
21+
{
22+
return QgsGeometryCheck::FeatureNodeCheck;
23+
}

src/analysis/vector/geometry_checker/qgsgeometrycheckfactory.h

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#ifndef QGSGEOMETRYCHECKFACTORY_H
1717
#define QGSGEOMETRYCHECKFACTORY_H
1818

19+
#define SIP_NO_FILE
20+
1921
#include <QString>
2022
#include <QMap>
2123
#include <QVariantMap>

src/analysis/vector/geometry_checker/qgsgeometrycheckregistry.h

+2
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
#ifndef QGSGEOMETRYCHECKREGISTRY_H
1717
#define QGSGEOMETRYCHECKREGISTRY_H
1818

19+
#define SIP_NO_FILE
20+
1921
#include <QString>
2022
#include <QMap>
2123
#include <QVariant>

src/app/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,7 @@ INCLUDE_DIRECTORIES(
634634
${CMAKE_SOURCE_DIR}/src/app/dwg
635635
${CMAKE_SOURCE_DIR}/src/app/mesh
636636
${CMAKE_SOURCE_DIR}/src/app/locator
637+
${CMAKE_SOURCE_DIR}/src/analysis
637638
${CMAKE_SOURCE_DIR}/src/analysis/raster
638639
${CMAKE_SOURCE_DIR}/src/core
639640
${CMAKE_SOURCE_DIR}/src/core/annotations

src/app/qgisapp.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
#include "qgsvectorlayerjoinbuffer.h"
8282
#include "qgsgeometryvalidationservice.h"
8383

84+
#include "qgsanalysis.h"
85+
#include "qgsgeometrycheckregistry.h"
86+
8487
#ifdef HAVE_3D
8588
#include "qgsabstract3drenderer.h"
8689
#include "qgs3danimationsettings.h"
@@ -922,6 +925,8 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
922925
functionProfile( &QgisApp::initLayouts, this, QStringLiteral( "Initialize layouts support" ) );
923926

924927
startProfile( QStringLiteral( "Geometry validation" ) );
928+
QgsAnalysis::instance()->geometryCheckRegistry()->initialize();
929+
925930
mGeometryValidationService = qgis::make_unique<QgsGeometryValidationService>( QgsProject::instance() );
926931
mGeometryValidationDock = new QgsGeometryValidationDock( tr( "Geometry Validation" ) );
927932
mGeometryValidationModel = new QgsGeometryValidationModel( mGeometryValidationService.get(), mGeometryValidationDock );

src/app/qgsvectorlayerproperties.cpp

+5-5
Original file line numberDiff line numberDiff line change
@@ -400,17 +400,17 @@ QgsVectorLayerProperties::QgsVectorLayerProperties(
400400
if ( mLayer->isSpatial() )
401401
{
402402
mRemoveDuplicateNodesCheckbox->setEnabled( true );
403-
mGeometryPrecisionSpinBox->setEnabled( true );
403+
mGeometryPrecisionLineEdit->setEnabled( true );
404404

405405
mRemoveDuplicateNodesCheckbox->setChecked( mLayer->geometryOptions()->removeDuplicateNodes() );
406-
mGeometryPrecisionSpinBox->setValue( mLayer->geometryOptions()->geometryPrecision() );
406+
mGeometryPrecisionLineEdit->setText( QString::number( mLayer->geometryOptions()->geometryPrecision() ) );
407407

408-
mGeometryPrecisionSpinBox->setSuffix( QStringLiteral( " [%1]" ).arg( QgsUnitTypes::toAbbreviatedString( mLayer->crs().mapUnits() ) ) );
408+
mPrecisionUnitsLabel->setText( QStringLiteral( "[%1]" ).arg( QgsUnitTypes::toAbbreviatedString( mLayer->crs().mapUnits() ) ) );
409409
}
410410
else
411411
{
412412
mRemoveDuplicateNodesCheckbox->setEnabled( false );
413-
mGeometryPrecisionSpinBox->setEnabled( false );
413+
mGeometryPrecisionLineEdit->setEnabled( false );
414414
mGeometryAutoFixesGroupBox->setEnabled( false );
415415
}
416416

@@ -753,7 +753,7 @@ void QgsVectorLayerProperties::apply()
753753
#endif
754754

755755
mLayer->geometryOptions()->setRemoveDuplicateNodes( mRemoveDuplicateNodesCheckbox->isChecked() );
756-
mLayer->geometryOptions()->setGeometryPrecision( mGeometryPrecisionSpinBox->value() );
756+
mLayer->geometryOptions()->setGeometryPrecision( mGeometryPrecisionLineEdit->text().toDouble() );
757757

758758
mLayer->triggerRepaint();
759759
// notify the project we've made a change

src/ui/qgsvectorlayerpropertiesbase.ui

+26-4
Original file line numberDiff line numberDiff line change
@@ -721,8 +721,8 @@ border-radius: 2px;</string>
721721
<rect>
722722
<x>0</x>
723723
<y>0</y>
724-
<width>100</width>
725-
<height>30</height>
724+
<width>653</width>
725+
<height>806</height>
726726
</rect>
727727
</property>
728728
<layout class="QVBoxLayout" name="verticalLayout_18">
@@ -907,8 +907,8 @@ border-radius: 2px;</string>
907907
<rect>
908908
<x>0</x>
909909
<y>0</y>
910-
<width>104</width>
911-
<height>102</height>
910+
<width>653</width>
911+
<height>806</height>
912912
</rect>
913913
</property>
914914
<layout class="QVBoxLayout" name="verticalLayout_23">
@@ -2410,6 +2410,28 @@ border-radius: 2px;</string>
24102410
</layout>
24112411
</widget>
24122412
</item>
2413+
<item row="1" column="0">
2414+
<widget class="QGroupBox" name="mGeometryValidationGroupBox">
2415+
<property name="title">
2416+
<string>Geometry validation</string>
2417+
</property>
2418+
<layout class="QGridLayout" name="gridLayout_13">
2419+
<item row="0" column="0">
2420+
<spacer name="verticalSpacer_4">
2421+
<property name="orientation">
2422+
<enum>Qt::Vertical</enum>
2423+
</property>
2424+
<property name="sizeHint" stdset="0">
2425+
<size>
2426+
<width>20</width>
2427+
<height>352</height>
2428+
</size>
2429+
</property>
2430+
</spacer>
2431+
</item>
2432+
</layout>
2433+
</widget>
2434+
</item>
24132435
</layout>
24142436
</widget>
24152437
</widget>

0 commit comments

Comments
 (0)