Skip to content

Commit f956464

Browse files
committedJan 20, 2015
Add snapping to current layer mode + make it default for new projects
1 parent cd7180e commit f956464

File tree

6 files changed

+364
-113
lines changed

6 files changed

+364
-113
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -572,7 +572,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, QWidget * parent,
572572
mSnappingUtils = new QgsMapCanvasSnappingUtils( mMapCanvas, this );
573573
mMapCanvas->setSnappingUtils( mSnappingUtils );
574574
connect( QgsProject::instance(), SIGNAL( snapSettingsChanged() ), mSnappingUtils, SLOT( readConfigFromProject() ) );
575-
connect( this, SIGNAL( newProject() ), mSnappingUtils, SLOT( readConfigFromProject() ) );
576575
connect( this, SIGNAL( projectRead() ), mSnappingUtils, SLOT( readConfigFromProject() ) );
577576

578577
createActions();

‎src/app/qgssnappingdialog.cpp

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,11 @@ QgsSnappingDialog::QgsSnappingDialog( QWidget* parent, QgsMapCanvas* canvas )
5757
{
5858
setupUi( this );
5959

60+
mDefaultSnapToComboBox->insertItem( 0, tr( "To vertex" ), "to vertex" );
61+
mDefaultSnapToComboBox->insertItem( 1, tr( "To segment" ), "to segment" );
62+
mDefaultSnapToComboBox->insertItem( 2, tr( "To vertex and segment" ), "to vertex and segment" );
63+
mDefaultSnapToComboBox->insertItem( 3, tr( "Off" ), "off" );
64+
6065
QSettings myQsettings;
6166
bool myDockFlag = myQsettings.value( "/qgis/dockSnapping", false ).toBool();
6267
if ( myDockFlag )
@@ -67,6 +72,11 @@ QgsSnappingDialog::QgsSnappingDialog( QWidget* parent, QgsMapCanvas* canvas )
6772
connect( this, SIGNAL( destroyed() ), mDock, SLOT( close() ) );
6873
QgisApp::instance()->addDockWidget( Qt::BottomDockWidgetArea, mDock );
6974
mButtonBox->setVisible( false );
75+
76+
connect( mSnapModeComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( apply() ) );
77+
connect( mDefaultSnapToComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( apply() ) );
78+
connect( mDefaultSnappingToleranceSpinBox, SIGNAL( valueChanged( double ) ), this, SLOT( apply() ) );
79+
connect( mDefaultSnappingToleranceComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( apply() ) );
7080
}
7181
else
7282
{
@@ -75,6 +85,7 @@ QgsSnappingDialog::QgsSnappingDialog( QWidget* parent, QgsMapCanvas* canvas )
7585
}
7686
connect( QgsMapLayerRegistry::instance(), SIGNAL( layersAdded( QList<QgsMapLayer * > ) ), this, SLOT( addLayers( QList<QgsMapLayer * > ) ) );
7787
connect( QgsMapLayerRegistry::instance(), SIGNAL( layersWillBeRemoved( QStringList ) ), this, SLOT( layersWillBeRemoved( QStringList ) ) );
88+
connect( mSnapModeComboBox, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onSnappingModeIndexChanged( int ) ) );
7889
connect( cbxEnableTopologicalEditingCheckBox, SIGNAL( stateChanged( int ) ), this, SLOT( on_cbxEnableTopologicalEditingCheckBox_stateChanged( int ) ) );
7990
connect( cbxEnableIntersectionSnappingCheckBox, SIGNAL( stateChanged( int ) ), this, SLOT( on_cbxEnableIntersectionSnappingCheckBox_stateChanged( int ) ) );
8091

@@ -91,6 +102,8 @@ QgsSnappingDialog::QgsSnappingDialog( QWidget* parent, QgsMapCanvas* canvas )
91102
mLayerTreeWidget->setSortingEnabled( true );
92103

93104
connect( QgsProject::instance(), SIGNAL( snapSettingsChanged() ), this, SLOT( reload() ) );
105+
connect( QgisApp::instance(), SIGNAL( newProject() ), this, SLOT( initNewProject() ) );
106+
connect( QgisApp::instance(), SIGNAL( projectRead() ), this, SLOT( reload() ) );
94107
}
95108

96109
QgsSnappingDialog::QgsSnappingDialog()
@@ -101,8 +114,33 @@ QgsSnappingDialog::~QgsSnappingDialog()
101114
{
102115
}
103116

117+
104118
void QgsSnappingDialog::reload()
105119
{
120+
setSnappingMode();
121+
122+
int idx;
123+
QSettings settings;
124+
QString snapType = settings.value( "/qgis/digitizing/default_snap_mode", "off" ).toString();
125+
snapType = QgsProject::instance()->readEntry( "Digitizing", "/DefaultSnapType", snapType );
126+
if ( snapType == "to segment" )
127+
idx = 1;
128+
else if ( snapType == "to vertex and segment" )
129+
idx = 2;
130+
else if ( snapType == "to vertex" )
131+
idx = 0;
132+
else // off
133+
idx = 4;
134+
mDefaultSnapToComboBox->setCurrentIndex( idx );
135+
136+
double tolerance = settings.value( "/qgis/digitizing/default_snapping_tolerance", 0 ).toDouble();
137+
tolerance = QgsProject::instance()->readDoubleEntry( "Digitizing", "/DefaultSnapTolerance", tolerance );
138+
mDefaultSnappingToleranceSpinBox->setValue( tolerance );
139+
140+
int unit = settings.value( "/qgis/digitizing/default_snapping_tolerance_unit", 0 ).toInt();
141+
unit = QgsProject::instance()->readNumEntry( "Digitizing", "/DefaultSnapToleranceUnit", unit );
142+
mDefaultSnappingToleranceComboBox->setCurrentIndex( unit );
143+
106144
mLayerTreeWidget->clear();
107145

108146
QMap< QString, QgsMapLayer *> mapLayers = QgsMapLayerRegistry::instance()->mapLayers();
@@ -127,6 +165,30 @@ void QgsSnappingDialog::on_cbxEnableIntersectionSnappingCheckBox_stateChanged( i
127165
QgsProject::instance()->writeEntry( "Digitizing", "/IntersectionSnapping", state == Qt::Checked );
128166
}
129167

168+
void QgsSnappingDialog::onSnappingModeIndexChanged( int index )
169+
{
170+
if ( index == 0 )
171+
mStackedWidget->setCurrentIndex( 0 );
172+
else
173+
mStackedWidget->setCurrentIndex( 1 );
174+
}
175+
176+
void QgsSnappingDialog::initNewProject()
177+
{
178+
QgsProject::instance()->writeEntry( "Digitizing", "/SnappingMode", QString( "current_layer" ) );
179+
180+
QSettings settings;
181+
QString snapType = settings.value( "/qgis/digitizing/default_snap_mode", "off" ).toString();
182+
QgsProject::instance()->writeEntry( "Digitizing", "/DefaultSnapType", snapType );
183+
double tolerance = settings.value( "/qgis/digitizing/default_snapping_tolerance", 0 ).toDouble();
184+
QgsProject::instance()->writeEntry( "Digitizing", "/DefaultSnapTolerance", tolerance );
185+
int unit = settings.value( "/qgis/digitizing/default_snapping_tolerance_unit", 0 ).toInt();
186+
QgsProject::instance()->writeEntry( "Digitizing", "/DefaultSnapToleranceUnit", unit );
187+
188+
reload();
189+
emitProjectSnapSettingsChanged();
190+
}
191+
130192
void QgsSnappingDialog::closeEvent( QCloseEvent* event )
131193
{
132194
QDialog::closeEvent( event );
@@ -141,6 +203,15 @@ void QgsSnappingDialog::closeEvent( QCloseEvent* event )
141203

142204
void QgsSnappingDialog::apply()
143205
{
206+
QString snapMode = mSnapModeComboBox->currentIndex() == 0 ? "current_layer" : "advanced";
207+
QgsProject::instance()->writeEntry( "Digitizing", "/SnappingMode", snapMode );
208+
209+
QString snapType = mDefaultSnapToComboBox->itemData( mDefaultSnapToComboBox->currentIndex() ).toString();
210+
QgsProject::instance()->writeEntry( "Digitizing", "/DefaultSnapType", snapType );
211+
QgsProject::instance()->writeEntry( "Digitizing", "/DefaultSnapTolerance", mDefaultSnappingToleranceSpinBox->value() );
212+
QgsProject::instance()->writeEntry( "Digitizing", "/DefaultSnapToleranceUnit", mDefaultSnappingToleranceComboBox->currentIndex() );
213+
214+
144215
QStringList layerIdList;
145216
QStringList snapToList;
146217
QStringList toleranceList;
@@ -190,6 +261,11 @@ void QgsSnappingDialog::apply()
190261
QgsProject::instance()->writeEntry( "Digitizing", "/LayerSnappingEnabledList", enabledList );
191262
QgsProject::instance()->writeEntry( "Digitizing", "/AvoidIntersectionsList", avoidIntersectionList );
192263

264+
emitProjectSnapSettingsChanged();
265+
}
266+
267+
void QgsSnappingDialog::emitProjectSnapSettingsChanged()
268+
{
193269
disconnect( QgsProject::instance(), SIGNAL( snapSettingsChanged() ), this, SLOT( reload() ) );
194270
connect( this, SIGNAL( snapSettingsChanged() ), QgsProject::instance(), SIGNAL( snapSettingsChanged() ) );
195271

@@ -405,3 +481,12 @@ void QgsSnappingDialog::setIntersectionSnappingState()
405481
cbxEnableIntersectionSnappingCheckBox->blockSignals( false );
406482
}
407483

484+
void QgsSnappingDialog::setSnappingMode()
485+
{
486+
QString snapMode = QgsProject::instance()->readEntry( "Digitizing", "/SnappingMode" );
487+
if ( snapMode == "current_layer" )
488+
mSnapModeComboBox->setCurrentIndex( 0 );
489+
else // "advanced" or empty (backward compatibility)
490+
mSnapModeComboBox->setCurrentIndex( 1 );
491+
}
492+

‎src/app/qgssnappingdialog.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ class APP_EXPORT QgsSnappingDialog: public QDialog, private Ui::QgsSnappingDialo
5757

5858
void on_cbxEnableIntersectionSnappingCheckBox_stateChanged( int );
5959

60+
void onSnappingModeIndexChanged( int );
61+
62+
void initNewProject();
63+
64+
void emitProjectSnapSettingsChanged();
65+
6066
protected:
6167
/**Constructor
6268
@param canvas pointer to the map canvas (for detecting which vector layers are loaded
@@ -92,6 +98,8 @@ class APP_EXPORT QgsSnappingDialog: public QDialog, private Ui::QgsSnappingDialo
9298

9399
/**Set checkbox value based on project setting*/
94100
void setIntersectionSnappingState();
101+
102+
void setSnappingMode();
95103
};
96104

97105
#endif

‎src/core/qgssnappingutils.cpp

Lines changed: 60 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
#include "qgsproject.h"
2121
#include "qgsvectorlayer.h"
2222

23-
#include <QSettings>
24-
2523

2624
QgsSnappingUtils::QgsSnappingUtils( QObject* parent )
2725
: QObject( parent )
2826
, mCurrentLayer( 0 )
2927
, mSnapToMapMode( SnapCurrentLayer )
28+
, mDefaultType( QgsPointLocator::Vertex )
29+
, mDefaultTolerance( 10 )
30+
, mDefaultUnit( QgsTolerance::Pixels )
3031
, mSnapOnIntersection( false )
3132
{
3233
connect( QgsMapLayerRegistry::instance(), SIGNAL( layersWillBeRemoved( QStringList ) ), this, SLOT( onLayersWillBeRemoved( QStringList ) ) );
@@ -59,20 +60,6 @@ void QgsSnappingUtils::clearAllLocators()
5960
}
6061

6162

62-
static int _defaultSnapMode()
63-
{
64-
QSettings settings;
65-
QString defaultSnapString = settings.value( "/qgis/digitizing/default_snap_mode", "off" ).toString();
66-
if ( defaultSnapString == "to segment" )
67-
return QgsPointLocator::Edge;
68-
else if ( defaultSnapString == "to vertex and segment" )
69-
return QgsPointLocator::Edge | QgsPointLocator::Vertex;
70-
else if ( defaultSnapString == "to vertex" )
71-
return QgsPointLocator::Vertex;
72-
else
73-
return 0;
74-
}
75-
7663
// return snap tolerance in map units (not in layer units as from QgsTolerance)
7764
static double _snapTolerance( double tolerance, QgsTolerance::UnitType units, const QgsMapSettings& mapSettings )
7865
{
@@ -82,76 +69,67 @@ static double _snapTolerance( double tolerance, QgsTolerance::UnitType units, co
8269
return tolerance * mapSettings.mapUnitsPerPixel();
8370
}
8471

85-
// return default snap tolerance in map units (not in layer units as from QgsTolerance)
86-
static double _defaultSnapTolerance( const QgsMapSettings& mapSettings )
87-
{
88-
QSettings settings;
89-
return _snapTolerance( settings.value( "/qgis/digitizing/default_snapping_tolerance", 0 ).toDouble(),
90-
( QgsTolerance::UnitType ) settings.value( "/qgis/digitizing/default_snapping_tolerance_unit", 0 ).toInt(),
91-
mapSettings );
92-
}
9372

94-
95-
static QgsPointLocator::Match _findClosestSegmentIntersection(const QgsPoint& pt, const QgsPointLocator::MatchList& segments)
73+
static QgsPointLocator::Match _findClosestSegmentIntersection( const QgsPoint& pt, const QgsPointLocator::MatchList& segments )
9674
{
9775
QSet<QgsPoint> endpoints;
9876

9977
// make a geometry
10078
QList<QgsGeometry*> geoms;
101-
foreach (const QgsPointLocator::Match& m, segments)
79+
foreach ( const QgsPointLocator::Match& m, segments )
10280
{
103-
if (m.hasEdge())
81+
if ( m.hasEdge() )
10482
{
105-
QgsPolyline pl(2);
106-
m.edgePoints(pl[0], pl[1]);
107-
geoms << QgsGeometry::fromPolyline(pl);
83+
QgsPolyline pl( 2 );
84+
m.edgePoints( pl[0], pl[1] );
85+
geoms << QgsGeometry::fromPolyline( pl );
10886
endpoints << pl[0] << pl[1];
10987
}
11088
}
11189

11290
QgsGeometry* g = QgsGeometry::unaryUnion( geoms );
113-
qDeleteAll(geoms);
91+
qDeleteAll( geoms );
11492

11593
// get intersection points
11694
QList<QgsPoint> newPoints;
117-
if (g->wkbType() == QGis::WKBLineString)
95+
if ( g->wkbType() == QGis::WKBLineString )
11896
{
119-
foreach (const QgsPoint& p, g->asPolyline())
97+
foreach ( const QgsPoint& p, g->asPolyline() )
12098
{
121-
if (!endpoints.contains(p))
99+
if ( !endpoints.contains( p ) )
122100
newPoints << p;
123101
}
124102
}
125-
if (g->wkbType() == QGis::WKBMultiLineString)
103+
if ( g->wkbType() == QGis::WKBMultiLineString )
126104
{
127-
foreach (const QgsPolyline& pl, g->asMultiPolyline())
105+
foreach ( const QgsPolyline& pl, g->asMultiPolyline() )
128106
{
129-
foreach (const QgsPoint& p, pl)
107+
foreach ( const QgsPoint& p, pl )
130108
{
131-
if (!endpoints.contains(p))
109+
if ( !endpoints.contains( p ) )
132110
newPoints << p;
133111
}
134112
}
135113
}
136114
delete g;
137115

138-
if (newPoints.isEmpty())
116+
if ( newPoints.isEmpty() )
139117
return QgsPointLocator::Match();
140118

141119
// find the closest points
142120
QgsPoint minP;
143121
double minSqrDist = 1e20; // "infinity"
144-
foreach (const QgsPoint& p, newPoints)
122+
foreach ( const QgsPoint& p, newPoints )
145123
{
146-
double sqrDist = pt.sqrDist(p.x(), p.y());
147-
if (sqrDist < minSqrDist)
124+
double sqrDist = pt.sqrDist( p.x(), p.y() );
125+
if ( sqrDist < minSqrDist )
148126
{
149127
minSqrDist = sqrDist;
150128
minP = p;
151129
}
152130
}
153131

154-
return QgsPointLocator::Match( QgsPointLocator::Vertex, 0, 0, sqrt(minSqrDist), minP );
132+
return QgsPointLocator::Match( QgsPointLocator::Vertex, 0, 0, sqrt( minSqrDist ), minP );
155133
}
156134

157135

@@ -169,9 +147,9 @@ QgsPointLocator::Match QgsSnappingUtils::snapToMap( const QgsPoint& pointMap )
169147
if ( !mCurrentLayer )
170148
return QgsPointLocator::Match();
171149

172-
// data from QSettings
173-
double tolerance = _defaultSnapTolerance( mMapSettings );
174-
int type = _defaultSnapMode();
150+
// data from project
151+
double tolerance = _snapTolerance( mDefaultTolerance, mDefaultUnit, mMapSettings );
152+
int type = mDefaultType;
175153

176154
// use ad-hoc locator
177155
QgsPointLocator* loc = locatorForLayer( mCurrentLayer );
@@ -213,7 +191,7 @@ QgsPointLocator::Match QgsSnappingUtils::snapToMap( const QgsPoint& pointMap )
213191
if ( mSnapOnIntersection )
214192
{
215193
edges << loc->edgesInTolerance( pointMap, tolerance );
216-
maxSnapIntTolerance = qMax(maxSnapIntTolerance, tolerance);
194+
maxSnapIntTolerance = qMax( maxSnapIntTolerance, tolerance );
217195
}
218196
}
219197
}
@@ -237,6 +215,20 @@ void QgsSnappingUtils::setMapSettings( const QgsMapSettings& settings )
237215
clearAllLocators();
238216
}
239217

218+
void QgsSnappingUtils::setDefaultSettings( int type, double tolerance, QgsTolerance::UnitType unit )
219+
{
220+
mDefaultType = type;
221+
mDefaultTolerance = tolerance;
222+
mDefaultUnit = unit;
223+
}
224+
225+
void QgsSnappingUtils::defaultSettings( int& type, double& tolerance, QgsTolerance::UnitType& unit )
226+
{
227+
type = mDefaultType;
228+
tolerance = mDefaultTolerance;
229+
unit = mDefaultUnit;
230+
}
231+
240232
const QgsCoordinateReferenceSystem* QgsSnappingUtils::destCRS()
241233
{
242234
return mMapSettings.hasCrsTransformEnabled() ? &mMapSettings.destinationCrs() : 0;
@@ -248,6 +240,20 @@ void QgsSnappingUtils::readConfigFromProject()
248240
mSnapToMapMode = SnapCurrentLayer;
249241
mLayers.clear();
250242

243+
QString snapMode = QgsProject::instance()->readEntry( "Digitizing", "/SnappingMode" );
244+
245+
int type = 0;
246+
QString snapType = QgsProject::instance()->readEntry( "Digitizing", "/DefaultSnapType", QString( "off" ) );
247+
if ( snapType == "to segment" )
248+
type = QgsPointLocator::Edge;
249+
else if ( snapType == "to vertex and segment" )
250+
type = QgsPointLocator::Vertex | QgsPointLocator::Edge;
251+
else if ( snapType == "to vertex" )
252+
type = QgsPointLocator::Vertex;
253+
double tolerance = QgsProject::instance()->readDoubleEntry( "Digitizing", "/DefaultSnapTolerance", 0 );
254+
QgsTolerance::UnitType unit = ( QgsTolerance::UnitType ) QgsProject::instance()->readNumEntry( "Digitizing", "/DefaultSnapToleranceUnit", 0 );
255+
setDefaultSettings( type, tolerance, unit );
256+
251257
//snapping on intersection on?
252258
setSnapOnIntersections( QgsProject::instance()->readNumEntry( "Digitizing", "/IntersectionSnapping", 0 ) );
253259

@@ -270,7 +276,12 @@ void QgsSnappingUtils::readConfigFromProject()
270276
return; // nothing defined in project - use current layer
271277

272278
// Use snapping information from the project
273-
mSnapToMapMode = SnapPerLayerConfig;
279+
if ( snapMode == "current_layer" )
280+
mSnapToMapMode = SnapCurrentLayer;
281+
else // either "advanced" or empty (for background compatibility)
282+
mSnapToMapMode = SnapPerLayerConfig;
283+
284+
274285

275286
// load layers, tolerances, snap type
276287
QStringList::const_iterator layerIt( layerIdList.constBegin() );

‎src/core/qgssnappingutils.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ class QgsSnappingUtils : public QObject
7070
/** Find out how the snapping to map is done */
7171
SnapToMapMode snapToMapMode() const { return mSnapToMapMode; }
7272

73+
/** configure options used when the mode is snap to current layer */
74+
void setDefaultSettings( int type, double tolerance, QgsTolerance::UnitType unit );
75+
/** query options used when the mode is snap to current layer */
76+
void defaultSettings( int& type, double& tolerance, QgsTolerance::UnitType& unit );
77+
7378
struct LayerConfig
7479
{
7580
LayerConfig( QgsVectorLayer* l, int t, double tol, QgsTolerance::UnitType u ) : layer( l ), type( t ), tolerance( tol ), unit( u ) {}
@@ -122,6 +127,9 @@ class QgsSnappingUtils : public QObject
122127

123128
// configuration
124129
SnapToMapMode mSnapToMapMode;
130+
int mDefaultType;
131+
double mDefaultTolerance;
132+
QgsTolerance::UnitType mDefaultUnit;
125133
QList<LayerConfig> mLayers;
126134
bool mSnapOnIntersection;
127135

‎src/ui/qgssnappingdialogbase.ui

Lines changed: 203 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -6,79 +6,209 @@
66
<rect>
77
<x>0</x>
88
<y>0</y>
9-
<width>760</width>
9+
<width>798</width>
1010
<height>290</height>
1111
</rect>
1212
</property>
1313
<property name="windowTitle">
1414
<string>Snapping options</string>
1515
</property>
16-
<layout class="QGridLayout" name="gridLayout">
17-
<property name="leftMargin">
18-
<number>0</number>
19-
</property>
20-
<property name="topMargin">
21-
<number>0</number>
22-
</property>
23-
<property name="rightMargin">
24-
<number>0</number>
25-
</property>
26-
<property name="bottomMargin">
27-
<number>3</number>
28-
</property>
29-
<item row="0" column="0" colspan="3">
30-
<widget class="QTreeWidget" name="mLayerTreeWidget">
31-
<property name="selectionMode">
32-
<enum>QAbstractItemView::NoSelection</enum>
33-
</property>
34-
<property name="indentation">
16+
<layout class="QVBoxLayout" name="verticalLayout">
17+
<item>
18+
<layout class="QHBoxLayout" name="horizontalLayout">
19+
<item>
20+
<widget class="QLabel" name="label">
21+
<property name="text">
22+
<string>Snapping mode</string>
23+
</property>
24+
</widget>
25+
</item>
26+
<item>
27+
<widget class="QComboBox" name="mSnapModeComboBox">
28+
<property name="sizePolicy">
29+
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
30+
<horstretch>0</horstretch>
31+
<verstretch>0</verstretch>
32+
</sizepolicy>
33+
</property>
34+
<item>
35+
<property name="text">
36+
<string>Current layer</string>
37+
</property>
38+
</item>
39+
<item>
40+
<property name="text">
41+
<string>Advanced</string>
42+
</property>
43+
</item>
44+
</widget>
45+
</item>
46+
<item>
47+
<spacer name="horizontalSpacer_2">
48+
<property name="orientation">
49+
<enum>Qt::Horizontal</enum>
50+
</property>
51+
<property name="sizeHint" stdset="0">
52+
<size>
53+
<width>40</width>
54+
<height>20</height>
55+
</size>
56+
</property>
57+
</spacer>
58+
</item>
59+
</layout>
60+
</item>
61+
<item>
62+
<widget class="QStackedWidget" name="mStackedWidget">
63+
<property name="currentIndex">
3564
<number>0</number>
3665
</property>
37-
<property name="rootIsDecorated">
38-
<bool>false</bool>
39-
</property>
40-
<column>
41-
<property name="text">
42-
<string/>
43-
</property>
44-
<property name="textAlignment">
45-
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
46-
</property>
47-
</column>
48-
<column>
49-
<property name="text">
50-
<string>Layer</string>
51-
</property>
52-
</column>
53-
<column>
54-
<property name="text">
55-
<string>Mode</string>
56-
</property>
57-
</column>
58-
<column>
59-
<property name="text">
60-
<string>Tolerance</string>
61-
</property>
62-
</column>
63-
<column>
64-
<property name="text">
65-
<string>Units</string>
66-
</property>
67-
</column>
68-
<column>
69-
<property name="text">
70-
<string>Avoid intersections</string>
71-
</property>
72-
<property name="toolTip">
73-
<string>Avoid intersections of new polygons</string>
74-
</property>
75-
<property name="textAlignment">
76-
<set>AlignLeft|AlignVCenter</set>
77-
</property>
78-
</column>
66+
<widget class="QWidget" name="page">
67+
<layout class="QGridLayout" name="gridLayout_3">
68+
<property name="margin">
69+
<number>0</number>
70+
</property>
71+
<item row="0" column="0">
72+
<layout class="QGridLayout" name="gridLayout">
73+
<item row="0" column="0">
74+
<widget class="QLabel" name="label_2">
75+
<property name="text">
76+
<string>Snap to</string>
77+
</property>
78+
</widget>
79+
</item>
80+
<item row="0" column="1" colspan="2">
81+
<widget class="QComboBox" name="mDefaultSnapToComboBox"/>
82+
</item>
83+
<item row="1" column="0">
84+
<widget class="QLabel" name="label_3">
85+
<property name="text">
86+
<string>Tolerance</string>
87+
</property>
88+
</widget>
89+
</item>
90+
<item row="1" column="1">
91+
<widget class="QDoubleSpinBox" name="mDefaultSnappingToleranceSpinBox">
92+
<property name="decimals">
93+
<number>5</number>
94+
</property>
95+
<property name="maximum">
96+
<double>99999999.989999994635582</double>
97+
</property>
98+
</widget>
99+
</item>
100+
<item row="1" column="2">
101+
<widget class="QComboBox" name="mDefaultSnappingToleranceComboBox">
102+
<property name="sizePolicy">
103+
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
104+
<horstretch>0</horstretch>
105+
<verstretch>0</verstretch>
106+
</sizepolicy>
107+
</property>
108+
<item>
109+
<property name="text">
110+
<string>map units</string>
111+
</property>
112+
</item>
113+
<item>
114+
<property name="text">
115+
<string>pixels</string>
116+
</property>
117+
</item>
118+
</widget>
119+
</item>
120+
</layout>
121+
</item>
122+
<item row="0" column="1">
123+
<spacer name="horizontalSpacer">
124+
<property name="orientation">
125+
<enum>Qt::Horizontal</enum>
126+
</property>
127+
<property name="sizeHint" stdset="0">
128+
<size>
129+
<width>390</width>
130+
<height>20</height>
131+
</size>
132+
</property>
133+
</spacer>
134+
</item>
135+
<item row="1" column="0">
136+
<spacer name="verticalSpacer">
137+
<property name="orientation">
138+
<enum>Qt::Vertical</enum>
139+
</property>
140+
<property name="sizeHint" stdset="0">
141+
<size>
142+
<width>20</width>
143+
<height>137</height>
144+
</size>
145+
</property>
146+
</spacer>
147+
</item>
148+
</layout>
149+
</widget>
150+
<widget class="QWidget" name="page_2">
151+
<layout class="QGridLayout" name="gridLayout_2">
152+
<property name="margin">
153+
<number>0</number>
154+
</property>
155+
<item row="0" column="0">
156+
<widget class="QTreeWidget" name="mLayerTreeWidget">
157+
<property name="selectionMode">
158+
<enum>QAbstractItemView::NoSelection</enum>
159+
</property>
160+
<property name="indentation">
161+
<number>0</number>
162+
</property>
163+
<property name="rootIsDecorated">
164+
<bool>false</bool>
165+
</property>
166+
<column>
167+
<property name="text">
168+
<string/>
169+
</property>
170+
<property name="textAlignment">
171+
<set>AlignHCenter|AlignVCenter|AlignCenter</set>
172+
</property>
173+
</column>
174+
<column>
175+
<property name="text">
176+
<string>Layer</string>
177+
</property>
178+
</column>
179+
<column>
180+
<property name="text">
181+
<string>Mode</string>
182+
</property>
183+
</column>
184+
<column>
185+
<property name="text">
186+
<string>Tolerance</string>
187+
</property>
188+
</column>
189+
<column>
190+
<property name="text">
191+
<string>Units</string>
192+
</property>
193+
</column>
194+
<column>
195+
<property name="text">
196+
<string>Avoid intersections</string>
197+
</property>
198+
<property name="toolTip">
199+
<string>Avoid intersections of new polygons</string>
200+
</property>
201+
<property name="textAlignment">
202+
<set>AlignLeft|AlignVCenter</set>
203+
</property>
204+
</column>
205+
</widget>
206+
</item>
207+
</layout>
208+
</widget>
79209
</widget>
80210
</item>
81-
<item row="2" column="0" colspan="3">
211+
<item>
82212
<layout class="QHBoxLayout" name="horizontalLayout_2">
83213
<property name="leftMargin">
84214
<number>3</number>
@@ -129,6 +259,16 @@
129259
</item>
130260
</layout>
131261
</widget>
262+
<tabstops>
263+
<tabstop>mSnapModeComboBox</tabstop>
264+
<tabstop>mDefaultSnapToComboBox</tabstop>
265+
<tabstop>mDefaultSnappingToleranceSpinBox</tabstop>
266+
<tabstop>mDefaultSnappingToleranceComboBox</tabstop>
267+
<tabstop>mLayerTreeWidget</tabstop>
268+
<tabstop>cbxEnableTopologicalEditingCheckBox</tabstop>
269+
<tabstop>cbxEnableIntersectionSnappingCheckBox</tabstop>
270+
<tabstop>mButtonBox</tabstop>
271+
</tabstops>
132272
<resources/>
133273
<connections>
134274
<connection>

0 commit comments

Comments
 (0)
Please sign in to comment.