Skip to content

Commit a2a26c2

Browse files
committedJun 29, 2014
[composer] Use pixels for snapping rather than mm, allowing for finer work when zoomed in. Merge grid and guide snapping settings to a single snap tolerance setting.
1 parent b43d131 commit a2a26c2

File tree

10 files changed

+184
-179
lines changed

10 files changed

+184
-179
lines changed
 

‎python/core/composer/qgscomposition.sip

Lines changed: 47 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,6 @@ class QgsComposition : QGraphicsScene
112112
void setSnapGridResolution( double r );
113113
double snapGridResolution() const;
114114

115-
void setSnapGridTolerance( double tolerance );
116-
double snapGridTolerance() const;
117-
118115
void setSnapGridOffsetX( double offset );
119116
double snapGridOffsetX() const;
120117

@@ -127,8 +124,53 @@ class QgsComposition : QGraphicsScene
127124
void setGridStyle( GridStyle s );
128125
GridStyle gridStyle() const;
129126

130-
void setAlignmentSnapTolerance( double t );
131-
double alignmentSnapTolerance() const;
127+
/**Sets the snap tolerance to use when automatically snapping items during movement and resizing to the
128+
* composition grid.
129+
* @param tolerance snap tolerance in pixels
130+
* @see snapGridTolerance
131+
* @deprecated Use setSnapTolerance instead
132+
*/
133+
void setSnapGridTolerance( double tolerance ) /Deprecated/;
134+
135+
/**Returns the snap tolerance to use when automatically snapping items during movement and resizing to the
136+
* composition grid.
137+
* @returns snap tolerance in pixels
138+
* @see setSnapGridTolerance
139+
* @deprecated Use snapTolerance instead
140+
*/
141+
double snapGridTolerance() const /Deprecated/;
142+
143+
/**Sets the snap tolerance to use when automatically snapping items during movement and resizing to guides
144+
* and the edges and centers of other items.
145+
* @param t snap tolerance in pixels
146+
* @see alignmentSnapTolerance
147+
* @deprecated Use setSnapTolerance instead
148+
*/
149+
void setAlignmentSnapTolerance( double t ) /Deprecated/;
150+
151+
/**Returns the snap tolerance to use when automatically snapping items during movement and resizing to guides
152+
* and the edges and centers of other items.
153+
* @returns snap tolerance in pixels
154+
* @see setAlignmentSnapTolerance
155+
* @deprecated Use snapTolerance instead
156+
*/
157+
double alignmentSnapTolerance() const /Deprecated/;
158+
159+
/**Sets the snap tolerance to use when automatically snapping items during movement and resizing to guides
160+
* and the edges and centers of other items.
161+
* @param t snap tolerance in pixels
162+
* @see alignmentSnapTolerance
163+
* @note Added in QGIS 2.5
164+
*/
165+
void setSnapTolerance( int snapTolerance );
166+
167+
/**Returns the snap tolerance to use when automatically snapping items during movement and resizing to guides
168+
* and the edges and centers of other items.
169+
* @returns snap tolerance in pixels
170+
* @see setAlignmentSnapTolerance
171+
* @note Added in QGIS 2.5
172+
*/
173+
int snapTolerance() const;
132174

133175
/**Returns pointer to undo/redo command storage*/
134176
QUndoStack* undoStack();

‎src/app/composer/qgscompositionwidget.cpp

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -79,14 +79,12 @@ QgsCompositionWidget::QgsCompositionWidget( QWidget* parent, QgsComposition* c )
7979
connect( mComposition, SIGNAL( composerMapAdded( QgsComposerMap* ) ), this, SLOT( onComposerMapAdded( QgsComposerMap* ) ) );
8080
connect( mComposition, SIGNAL( itemRemoved( QgsComposerItem* ) ), this, SLOT( onItemRemoved( QgsComposerItem* ) ) );
8181

82-
mAlignmentToleranceSpinBox->setValue( mComposition->alignmentSnapTolerance() );
82+
mSnapToleranceSpinBox->setValue( mComposition->snapTolerance() );
8383

8484
//snap grid
8585
mGridResolutionSpinBox->setValue( mComposition->snapGridResolution() );
8686
mOffsetXSpinBox->setValue( mComposition->snapGridOffsetX() );
8787
mOffsetYSpinBox->setValue( mComposition->snapGridOffsetY() );
88-
89-
mGridToleranceSpinBox->setValue( mComposition->snapGridTolerance() );
9088
}
9189
blockSignals( false );
9290
}
@@ -559,19 +557,11 @@ void QgsCompositionWidget::on_mOffsetYSpinBox_valueChanged( double d )
559557
}
560558
}
561559

562-
void QgsCompositionWidget::on_mGridToleranceSpinBox_valueChanged( double d )
563-
{
564-
if ( mComposition )
565-
{
566-
mComposition->setSnapGridTolerance( d );
567-
}
568-
}
569-
570-
void QgsCompositionWidget::on_mAlignmentToleranceSpinBox_valueChanged( double d )
560+
void QgsCompositionWidget::on_mSnapToleranceSpinBox_valueChanged( int tolerance )
571561
{
572562
if ( mComposition )
573563
{
574-
mComposition->setAlignmentSnapTolerance( d );
564+
mComposition->setSnapTolerance( tolerance );
575565
}
576566
}
577567

@@ -589,7 +579,6 @@ void QgsCompositionWidget::blockSignals( bool block )
589579
mGridResolutionSpinBox->blockSignals( block );
590580
mOffsetXSpinBox->blockSignals( block );
591581
mOffsetYSpinBox->blockSignals( block );
592-
mGridToleranceSpinBox->blockSignals( block );
593-
mAlignmentToleranceSpinBox->blockSignals( block );
582+
mSnapToleranceSpinBox->blockSignals( block );
594583
}
595584

‎src/app/composer/qgscompositionwidget.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,8 +57,7 @@ class QgsCompositionWidget: public QWidget, private Ui::QgsCompositionWidgetBase
5757
void on_mGridResolutionSpinBox_valueChanged( double d );
5858
void on_mOffsetXSpinBox_valueChanged( double d );
5959
void on_mOffsetYSpinBox_valueChanged( double d );
60-
void on_mGridToleranceSpinBox_valueChanged( double d );
61-
void on_mAlignmentToleranceSpinBox_valueChanged( double d );
60+
void on_mSnapToleranceSpinBox_valueChanged( int tolerance );
6261

6362
/**Sets GUI elements to width/height from composition*/
6463
void displayCompositionWidthHeight();

‎src/app/qgsoptions.cpp

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -723,15 +723,12 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl ) :
723723
mGridStyleComboBox->setCurrentIndex( 1 );
724724
}
725725

726-
//grid defaults
726+
//grid and guide defaults
727727
mGridResolutionSpinBox->setValue( settings.value( "/Composer/defaultSnapGridResolution", 10.0 ).toDouble() );
728-
mGridToleranceSpinBox->setValue( settings.value( "/Composer/defaultSnapGridTolerance", 2 ).toDouble() );
728+
mSnapToleranceSpinBox->setValue( settings.value( "/Composer/defaultSnapTolerancePixels", 10 ).toInt() );
729729
mOffsetXSpinBox->setValue( settings.value( "/Composer/defaultSnapGridOffsetX", 0 ).toDouble() );
730730
mOffsetYSpinBox->setValue( settings.value( "/Composer/defaultSnapGridOffsetY", 0 ).toDouble() );
731731

732-
//guide defaults
733-
mGuideToleranceSpinBox->setValue( settings.value( "/Composer/defaultSnapGuideTolerance", 2 ).toDouble() );
734-
735732
//
736733
// Locale settings
737734
//
@@ -1311,15 +1308,12 @@ void QgsOptions::saveOptions()
13111308
settings.setValue( "/Composer/gridStyle", "Crosses" );
13121309
}
13131310

1314-
//grid defaults
1311+
//grid and guide defaults
13151312
settings.setValue( "/Composer/defaultSnapGridResolution", mGridResolutionSpinBox->value() );
1316-
settings.setValue( "/Composer/defaultSnapGridTolerance", mGridToleranceSpinBox->value() );
1313+
settings.setValue( "/Composer/defaultSnapTolerancePixels", mSnapToleranceSpinBox->value() );
13171314
settings.setValue( "/Composer/defaultSnapGridOffsetX", mOffsetXSpinBox->value() );
13181315
settings.setValue( "/Composer/defaultSnapGridOffsetY", mOffsetYSpinBox->value() );
13191316

1320-
//guide defaults
1321-
settings.setValue( "/Composer/defaultSnapGuideTolerance", mGuideToleranceSpinBox->value() );
1322-
13231317
//
13241318
// Locale settings
13251319
//

‎src/core/composer/qgscomposermousehandles.cpp

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,8 +1229,12 @@ QPointF QgsComposerMouseHandles::alignPos( const QPointF& pos, double& alignX, d
12291229
return pos;
12301230
}
12311231

1232+
//convert snap tolerance from pixels to mm
1233+
double viewScaleFactor = graphicsView()->transform().m11();
1234+
double alignThreshold = mComposition->snapTolerance() / viewScaleFactor;
1235+
12321236
QPointF result( pos.x(), pos.y() );
1233-
if ( abs( nearestX - pos.x() ) < mComposition->alignmentSnapTolerance() )
1237+
if ( fabs( nearestX - pos.x() ) < alignThreshold )
12341238
{
12351239
result.setX( nearestX );
12361240
alignX = nearestX;
@@ -1240,7 +1244,7 @@ QPointF QgsComposerMouseHandles::alignPos( const QPointF& pos, double& alignX, d
12401244
alignX = -1;
12411245
}
12421246

1243-
if ( abs( nearestY - pos.y() ) < mComposition->alignmentSnapTolerance() )
1247+
if ( fabs( nearestY - pos.y() ) < alignThreshold )
12441248
{
12451249
result.setY( nearestY );
12461250
alignY = nearestY;
@@ -1309,16 +1313,20 @@ void QgsComposerMouseHandles::collectAlignCoordinates( QMap< double, const QgsCo
13091313
}
13101314
}
13111315

1312-
void QgsComposerMouseHandles::checkNearestItem( double checkCoord, const QMap< double, const QgsComposerItem* >& alignCoords, double& smallestDiff, double itemCoordOffset, double& itemCoord, double& alignCoord ) const
1316+
void QgsComposerMouseHandles::checkNearestItem( double checkCoord, const QMap< double, const QgsComposerItem* >& alignCoords, double& smallestDiff, double itemCoordOffset, double& itemCoord, double& alignCoord )
13131317
{
13141318
double currentCoord = 0;
13151319
if ( !nearestItem( alignCoords, checkCoord, currentCoord ) )
13161320
{
13171321
return;
13181322
}
13191323

1320-
double currentDiff = abs( checkCoord - currentCoord );
1321-
if ( currentDiff < mComposition->alignmentSnapTolerance() && currentDiff < smallestDiff )
1324+
double currentDiff = fabs( checkCoord - currentCoord );
1325+
//convert snap tolerance from pixels to mm
1326+
double viewScaleFactor = graphicsView()->transform().m11();
1327+
double alignThreshold = mComposition->snapTolerance() / viewScaleFactor;
1328+
1329+
if ( currentDiff < alignThreshold && currentDiff < smallestDiff )
13221330
{
13231331
itemCoord = currentCoord + itemCoordOffset;
13241332
alignCoord = currentCoord;

‎src/core/composer/qgscomposermousehandles.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ class CORE_EXPORT QgsComposerMouseHandles: public QObject, public QGraphicsRectI
188188
//helper functions for item align
189189
void collectAlignCoordinates( QMap< double, const QgsComposerItem* >& alignCoordsX, QMap< double, const QgsComposerItem* >& alignCoordsY );
190190
bool nearestItem( const QMap< double, const QgsComposerItem* >& coords, double value, double& nearestValue ) const;
191-
void checkNearestItem( double checkCoord, const QMap< double, const QgsComposerItem* >& alignCoords, double& smallestDiff, double itemCoordOffset, double& itemCoord, double& alignCoord ) const;
191+
void checkNearestItem( double checkCoord, const QMap< double, const QgsComposerItem* >& alignCoords, double& smallestDiff, double itemCoordOffset, double& itemCoord, double& alignCoord );
192192

193193
//tries to return the current QGraphicsView attached to the composition
194194
QGraphicsView* graphicsView();

‎src/core/composer/qgscomposition.cpp

Lines changed: 25 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@
4343
#include <QDomDocument>
4444
#include <QDomElement>
4545
#include <QGraphicsRectItem>
46+
#include <QGraphicsView>
4647
#include <QPainter>
4748
#include <QPrinter>
4849
#include <QSettings>
@@ -83,13 +84,12 @@ void QgsComposition::init()
8384
mSnapToGrid = false;
8485
mGridVisible = false;
8586
mSnapGridResolution = 0;
86-
mSnapGridTolerance = 0;
8787
mSnapGridOffsetX = 0;
8888
mSnapGridOffsetY = 0;
8989
mAlignmentSnap = true;
9090
mGuidesVisible = true;
9191
mSmartGuides = true;
92-
mAlignmentSnapTolerance = 0;
92+
mSnapTolerance = 0;
9393
mSelectionHandles = 0;
9494
mActiveItemCommand = 0;
9595
mActiveMultiFrameCommand = 0;
@@ -170,10 +170,9 @@ void QgsComposition::loadDefaults()
170170
{
171171
QSettings settings;
172172
mSnapGridResolution = settings.value( "/Composer/defaultSnapGridResolution", 10.0 ).toDouble();
173-
mSnapGridTolerance = settings.value( "/Composer/defaultSnapGridTolerance", 2 ).toDouble();
174173
mSnapGridOffsetX = settings.value( "/Composer/defaultSnapGridOffsetX", 0 ).toDouble();
175174
mSnapGridOffsetY = settings.value( "/Composer/defaultSnapGridOffsetY", 0 ).toDouble();
176-
mAlignmentSnapTolerance = settings.value( "/Composer/defaultSnapGuideTolerance", 2 ).toDouble();
175+
mSnapTolerance = settings.value( "/Composer/defaultSnapTolerancePixels", 10 ).toInt();
177176
}
178177

179178
void QgsComposition::updateBounds()
@@ -640,7 +639,6 @@ bool QgsComposition::writeXML( QDomElement& composerElem, QDomDocument& doc )
640639
compositionElem.setAttribute( "gridVisible", "0" );
641640
}
642641
compositionElem.setAttribute( "snapGridResolution", QString::number( mSnapGridResolution ) );
643-
compositionElem.setAttribute( "snapGridTolerance", QString::number( mSnapGridTolerance ) );
644642
compositionElem.setAttribute( "snapGridOffsetX", QString::number( mSnapGridOffsetX ) );
645643
compositionElem.setAttribute( "snapGridOffsetY", QString::number( mSnapGridOffsetY ) );
646644

@@ -669,7 +667,7 @@ bool QgsComposition::writeXML( QDomElement& composerElem, QDomDocument& doc )
669667
compositionElem.setAttribute( "alignmentSnap", mAlignmentSnap ? 1 : 0 );
670668
compositionElem.setAttribute( "guidesVisible", mGuidesVisible ? 1 : 0 );
671669
compositionElem.setAttribute( "smartGuides", mSmartGuides ? 1 : 0 );
672-
compositionElem.setAttribute( "alignmentSnapTolerance", mAlignmentSnapTolerance );
670+
compositionElem.setAttribute( "snapTolerancePixels", mSnapTolerance );
673671

674672
//save items except paper items and frame items (they are saved with the corresponding multiframe)
675673
QList<QGraphicsItem*> itemList = items();
@@ -733,14 +731,13 @@ bool QgsComposition::readXML( const QDomElement& compositionElem, const QDomDocu
733731
mGridVisible = compositionElem.attribute( "gridVisible", "0" ).toInt() == 0 ? false : true;
734732

735733
mSnapGridResolution = compositionElem.attribute( "snapGridResolution" ).toDouble();
736-
mSnapGridTolerance = compositionElem.attribute( "snapGridTolerance", "2.0" ).toDouble();
737734
mSnapGridOffsetX = compositionElem.attribute( "snapGridOffsetX" ).toDouble();
738735
mSnapGridOffsetY = compositionElem.attribute( "snapGridOffsetY" ).toDouble();
739736

740737
mAlignmentSnap = compositionElem.attribute( "alignmentSnap", "1" ).toInt() == 0 ? false : true;
741738
mGuidesVisible = compositionElem.attribute( "guidesVisible", "1" ).toInt() == 0 ? false : true;
742739
mSmartGuides = compositionElem.attribute( "smartGuides", "1" ).toInt() == 0 ? false : true;
743-
mAlignmentSnapTolerance = compositionElem.attribute( "alignmentSnapTolerance", "2.0" ).toDouble();
740+
mSnapTolerance = compositionElem.attribute( "snapTolerancePixels", "10" ).toInt();
744741

745742
//custom snap lines
746743
QDomNodeList snapLineNodes = compositionElem.elementsByTagName( "SnapLine" );
@@ -1733,7 +1730,7 @@ void QgsComposition::refreshZList()
17331730

17341731
QPointF QgsComposition::snapPointToGrid( const QPointF& scenePoint ) const
17351732
{
1736-
if ( !mSnapToGrid || mSnapGridResolution <= 0 )
1733+
if ( !mSnapToGrid || mSnapGridResolution <= 0 || !graphicsView() )
17371734
{
17381735
return scenePoint;
17391736
}
@@ -1750,12 +1747,16 @@ QPointF QgsComposition::snapPointToGrid( const QPointF& scenePoint ) const
17501747
double xSnapped = xRatio * mSnapGridResolution + mSnapGridOffsetX;
17511748
double ySnapped = yRatio * mSnapGridResolution + mSnapGridOffsetY + yOffset;
17521749

1753-
if ( abs( xSnapped - scenePoint.x() ) > mSnapGridTolerance )
1750+
//convert snap tolerance from pixels to mm
1751+
double viewScaleFactor = graphicsView()->transform().m11();
1752+
double alignThreshold = mSnapTolerance / viewScaleFactor;
1753+
1754+
if ( fabs( xSnapped - scenePoint.x() ) > alignThreshold )
17541755
{
17551756
//snap distance is outside of tolerance
17561757
xSnapped = scenePoint.x();
17571758
}
1758-
if ( abs( ySnapped - scenePoint.y() ) > mSnapGridTolerance )
1759+
if ( fabs( ySnapped - scenePoint.y() ) > alignThreshold )
17591760
{
17601761
//snap distance is outside of tolerance
17611762
ySnapped = scenePoint.y();
@@ -1961,11 +1962,6 @@ void QgsComposition::setSnapGridResolution( double r )
19611962
updatePaperItems();
19621963
}
19631964

1964-
void QgsComposition::setSnapGridTolerance( double tolerance )
1965-
{
1966-
mSnapGridTolerance = tolerance;
1967-
}
1968-
19691965
void QgsComposition::setSnapGridOffsetX( double offset )
19701966
{
19711967
mSnapGridOffsetX = offset;
@@ -2578,6 +2574,19 @@ QString QgsComposition::encodeStringForXML( const QString& str )
25782574
return modifiedStr;
25792575
}
25802576

2577+
QGraphicsView *QgsComposition::graphicsView() const
2578+
{
2579+
//try to find current view attached to composition
2580+
QList<QGraphicsView*> viewList = views();
2581+
if ( viewList.size() > 0 )
2582+
{
2583+
return viewList.at( 0 );
2584+
}
2585+
2586+
//no view attached to composition
2587+
return 0;
2588+
}
2589+
25812590
void QgsComposition::computeWorldFileParameters( double& a, double& b, double& c, double& d, double& e, double& f ) const
25822591
{
25832592
//

‎src/core/composer/qgscomposition.h

Lines changed: 51 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -168,9 +168,6 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
168168
void setSnapGridResolution( double r );
169169
double snapGridResolution() const {return mSnapGridResolution;}
170170

171-
void setSnapGridTolerance( double tolerance );
172-
double snapGridTolerance() const {return mSnapGridTolerance;}
173-
174171
void setSnapGridOffsetX( double offset );
175172
double snapGridOffsetX() const {return mSnapGridOffsetX;}
176173

@@ -183,8 +180,53 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
183180
void setGridStyle( GridStyle s );
184181
GridStyle gridStyle() const {return mGridStyle;}
185182

186-
void setAlignmentSnapTolerance( double t ) { mAlignmentSnapTolerance = t; }
187-
double alignmentSnapTolerance() const { return mAlignmentSnapTolerance; }
183+
/**Sets the snap tolerance to use when automatically snapping items during movement and resizing to the
184+
* composition grid.
185+
* @param tolerance snap tolerance in pixels
186+
* @see snapGridTolerance
187+
* @deprecated Use setSnapTolerance instead
188+
*/
189+
Q_DECL_DEPRECATED void setSnapGridTolerance( double tolerance ) { mSnapTolerance = tolerance; }
190+
191+
/**Returns the snap tolerance to use when automatically snapping items during movement and resizing to the
192+
* composition grid.
193+
* @returns snap tolerance in pixels
194+
* @see setSnapGridTolerance
195+
* @deprecated Use snapTolerance instead
196+
*/
197+
Q_DECL_DEPRECATED double snapGridTolerance() const {return mSnapTolerance;}
198+
199+
/**Sets the snap tolerance to use when automatically snapping items during movement and resizing to guides
200+
* and the edges and centers of other items.
201+
* @param t snap tolerance in pixels
202+
* @see alignmentSnapTolerance
203+
* @deprecated Use setSnapTolerance instead
204+
*/
205+
Q_DECL_DEPRECATED void setAlignmentSnapTolerance( double t ) { mSnapTolerance = t; }
206+
207+
/**Returns the snap tolerance to use when automatically snapping items during movement and resizing to guides
208+
* and the edges and centers of other items.
209+
* @returns snap tolerance in pixels
210+
* @see setAlignmentSnapTolerance
211+
* @deprecated Use snapTolerance instead
212+
*/
213+
Q_DECL_DEPRECATED double alignmentSnapTolerance() const { return mSnapTolerance; }
214+
215+
/**Sets the snap tolerance to use when automatically snapping items during movement and resizing to guides
216+
* and the edges and centers of other items.
217+
* @param t snap tolerance in pixels
218+
* @see alignmentSnapTolerance
219+
* @note Added in QGIS 2.5
220+
*/
221+
void setSnapTolerance( int snapTolerance ) { mSnapTolerance = snapTolerance; }
222+
223+
/**Returns the snap tolerance to use when automatically snapping items during movement and resizing to guides
224+
* and the edges and centers of other items.
225+
* @returns snap tolerance in pixels
226+
* @see setAlignmentSnapTolerance
227+
* @note Added in QGIS 2.5
228+
*/
229+
int snapTolerance() const { return mSnapTolerance; }
188230

189231
/**Returns pointer to undo/redo command storage*/
190232
QUndoStack* undoStack() { return &mUndoStack; }
@@ -524,7 +566,6 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
524566
bool mSnapToGrid;
525567
bool mGridVisible;
526568
double mSnapGridResolution;
527-
double mSnapGridTolerance;
528569
double mSnapGridOffsetX;
529570
double mSnapGridOffsetY;
530571
QPen mGridPen;
@@ -534,7 +575,7 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
534575
bool mAlignmentSnap;
535576
bool mGuidesVisible;
536577
bool mSmartGuides;
537-
double mAlignmentSnapTolerance;
578+
int mSnapTolerance;
538579

539580
/**Arbitraty snap lines (horizontal and vertical)*/
540581
QList< QGraphicsLineItem* > mSnapLines;
@@ -581,6 +622,9 @@ class CORE_EXPORT QgsComposition : public QGraphicsScene
581622

582623
static QString encodeStringForXML( const QString& str );
583624

625+
//tries to return the current QGraphicsView attached to the composition
626+
QGraphicsView* graphicsView() const;
627+
584628
bool mPreventCursorChange;
585629

586630
signals:

‎src/ui/qgscompositionwidgetbase.ui

Lines changed: 8 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,7 @@
297297
<item>
298298
<widget class="QgsCollapsibleGroupBoxBasic" name="mSnapToGridGroupCheckBox">
299299
<property name="title">
300-
<string>Grid</string>
300+
<string>Guides and Grid</string>
301301
</property>
302302
<property name="checkable">
303303
<bool>false</bool>
@@ -321,7 +321,7 @@
321321
<item row="0" column="0">
322322
<widget class="QLabel" name="label_8">
323323
<property name="text">
324-
<string>Spacing</string>
324+
<string>Grid spacing</string>
325325
</property>
326326
<property name="wordWrap">
327327
<bool>true</bool>
@@ -382,66 +382,19 @@
382382
</layout>
383383
</item>
384384
<item row="2" column="0">
385-
<widget class="QLabel" name="label_4">
385+
<widget class="QLabel" name="label_7">
386386
<property name="text">
387-
<string>Tolerance</string>
388-
</property>
389-
<property name="wordWrap">
390-
<bool>true</bool>
387+
<string>Snap tolerance</string>
391388
</property>
392389
</widget>
393390
</item>
394391
<item row="2" column="1">
395-
<widget class="QDoubleSpinBox" name="mGridToleranceSpinBox">
396-
<property name="prefix">
397-
<string/>
398-
</property>
392+
<widget class="QSpinBox" name="mSnapToleranceSpinBox">
399393
<property name="suffix">
400-
<string> mm</string>
401-
</property>
402-
<property name="value">
403-
<double>2.000000000000000</double>
394+
<string> px</string>
404395
</property>
405-
</widget>
406-
</item>
407-
</layout>
408-
</widget>
409-
</item>
410-
<item>
411-
<widget class="QgsCollapsibleGroupBoxBasic" name="mAlignmentSnapGroupCheckBox">
412-
<property name="title">
413-
<string>Snap to alignments</string>
414-
</property>
415-
<property name="checkable">
416-
<bool>false</bool>
417-
</property>
418-
<property name="syncGroup" stdset="0">
419-
<string notr="true">composeritem</string>
420-
</property>
421-
<property name="collapsed" stdset="0">
422-
<bool>true</bool>
423-
</property>
424-
<layout class="QFormLayout" name="formLayout_3">
425-
<property name="fieldGrowthPolicy">
426-
<enum>QFormLayout::AllNonFixedFieldsGrow</enum>
427-
</property>
428-
<property name="labelAlignment">
429-
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
430-
</property>
431-
<item row="0" column="0">
432-
<widget class="QLabel" name="label_7">
433-
<property name="text">
434-
<string>Tolerance</string>
435-
</property>
436-
</widget>
437-
</item>
438-
<item row="0" column="1">
439-
<widget class="QDoubleSpinBox" name="mAlignmentToleranceSpinBox">
440-
<property name="prefix">
441-
<string/>
442-
</property>
443-
<property name="suffix">
444-
<string> mm</string>
396+
<property name="maximum">
397+
<number>200</number>
445398
</property>
446399
</widget>
447400
</item>

‎src/ui/qgsoptionsbase.ui

Lines changed: 30 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -271,8 +271,8 @@
271271
<rect>
272272
<x>0</x>
273273
<y>0</y>
274-
<width>613</width>
275-
<height>599</height>
274+
<width>610</width>
275+
<height>640</height>
276276
</rect>
277277
</property>
278278
<layout class="QVBoxLayout" name="verticalLayout_28">
@@ -934,8 +934,8 @@
934934
<rect>
935935
<x>0</x>
936936
<y>0</y>
937-
<width>621</width>
938-
<height>860</height>
937+
<width>655</width>
938+
<height>862</height>
939939
</rect>
940940
</property>
941941
<layout class="QVBoxLayout" name="verticalLayout_22">
@@ -1309,8 +1309,8 @@
13091309
<rect>
13101310
<x>0</x>
13111311
<y>0</y>
1312-
<width>626</width>
1313-
<height>549</height>
1312+
<width>531</width>
1313+
<height>440</height>
13141314
</rect>
13151315
</property>
13161316
<layout class="QVBoxLayout" name="verticalLayout_27">
@@ -1619,8 +1619,8 @@
16191619
<rect>
16201620
<x>0</x>
16211621
<y>0</y>
1622-
<width>661</width>
1623-
<height>751</height>
1622+
<width>710</width>
1623+
<height>796</height>
16241624
</rect>
16251625
</property>
16261626
<layout class="QVBoxLayout" name="verticalLayout_29">
@@ -2258,8 +2258,8 @@
22582258
<rect>
22592259
<x>0</x>
22602260
<y>0</y>
2261-
<width>626</width>
2262-
<height>549</height>
2261+
<width>486</width>
2262+
<height>330</height>
22632263
</rect>
22642264
</property>
22652265
<layout class="QVBoxLayout" name="verticalLayout_25">
@@ -2587,8 +2587,8 @@
25872587
<rect>
25882588
<x>0</x>
25892589
<y>0</y>
2590-
<width>626</width>
2591-
<height>652</height>
2590+
<width>664</width>
2591+
<height>628</height>
25922592
</rect>
25932593
</property>
25942594
<layout class="QVBoxLayout" name="verticalLayout_30">
@@ -3083,8 +3083,8 @@
30833083
<rect>
30843084
<x>0</x>
30853085
<y>0</y>
3086-
<width>464</width>
3087-
<height>367</height>
3086+
<width>626</width>
3087+
<height>549</height>
30883088
</rect>
30893089
</property>
30903090
<layout class="QVBoxLayout" name="verticalLayout_39">
@@ -3150,13 +3150,13 @@
31503150
<item>
31513151
<widget class="QgsCollapsibleGroupBox" name="groupBox_24">
31523152
<property name="title">
3153-
<string>Grid defaults</string>
3153+
<string>Grid and guide defaults</string>
31543154
</property>
31553155
<layout class="QGridLayout" name="gridLayout_11">
31563156
<item row="0" column="0">
31573157
<widget class="QLabel" name="label_61">
31583158
<property name="text">
3159-
<string>Spacing</string>
3159+
<string>Grid spacing</string>
31603160
</property>
31613161
</widget>
31623162
</item>
@@ -3215,51 +3215,18 @@
32153215
</widget>
32163216
</item>
32173217
<item row="1" column="1">
3218-
<widget class="QDoubleSpinBox" name="mGridToleranceSpinBox">
3219-
<property name="prefix">
3220-
<string/>
3221-
</property>
3218+
<widget class="QSpinBox" name="mSnapToleranceSpinBox">
32223219
<property name="suffix">
3223-
<string> mm</string>
3220+
<string> px</string>
32243221
</property>
3225-
<property name="value">
3226-
<double>2.000000000000000</double>
3222+
<property name="maximum">
3223+
<number>200</number>
32273224
</property>
32283225
</widget>
32293226
</item>
32303227
</layout>
32313228
</widget>
32323229
</item>
3233-
<item>
3234-
<widget class="QgsCollapsibleGroupBox" name="groupBox_25">
3235-
<property name="title">
3236-
<string>Guide defaults</string>
3237-
</property>
3238-
<layout class="QGridLayout" name="gridLayout_12">
3239-
<item row="0" column="0">
3240-
<layout class="QHBoxLayout" name="horizontalLayout_37">
3241-
<item>
3242-
<widget class="QLabel" name="label_64">
3243-
<property name="text">
3244-
<string>Snap tolerance</string>
3245-
</property>
3246-
</widget>
3247-
</item>
3248-
<item>
3249-
<widget class="QDoubleSpinBox" name="mGuideToleranceSpinBox">
3250-
<property name="prefix">
3251-
<string/>
3252-
</property>
3253-
<property name="suffix">
3254-
<string> mm</string>
3255-
</property>
3256-
</widget>
3257-
</item>
3258-
</layout>
3259-
</item>
3260-
</layout>
3261-
</widget>
3262-
</item>
32633230
<item>
32643231
<spacer name="verticalSpacer_10">
32653232
<property name="orientation">
@@ -3297,8 +3264,8 @@
32973264
<rect>
32983265
<x>0</x>
32993266
<y>0</y>
3300-
<width>461</width>
3301-
<height>607</height>
3267+
<width>501</width>
3268+
<height>640</height>
33023269
</rect>
33033270
</property>
33043271
<layout class="QVBoxLayout" name="verticalLayout_31">
@@ -3788,8 +3755,8 @@
37883755
<rect>
37893756
<x>0</x>
37903757
<y>0</y>
3791-
<width>437</width>
3792-
<height>363</height>
3758+
<width>462</width>
3759+
<height>372</height>
37933760
</rect>
37943761
</property>
37953762
<layout class="QVBoxLayout" name="verticalLayout_6">
@@ -3918,8 +3885,8 @@
39183885
<rect>
39193886
<x>0</x>
39203887
<y>0</y>
3921-
<width>603</width>
3922-
<height>694</height>
3888+
<width>650</width>
3889+
<height>707</height>
39233890
</rect>
39243891
</property>
39253892
<layout class="QGridLayout" name="gridLayout_15">
@@ -4172,8 +4139,8 @@
41724139
<rect>
41734140
<x>0</x>
41744141
<y>0</y>
4175-
<width>280</width>
4176-
<height>212</height>
4142+
<width>300</width>
4143+
<height>226</height>
41774144
</rect>
41784145
</property>
41794146
<layout class="QVBoxLayout" name="verticalLayout_32">
@@ -4262,8 +4229,8 @@
42624229
<rect>
42634230
<x>0</x>
42644231
<y>0</y>
4265-
<width>613</width>
4266-
<height>668</height>
4232+
<width>531</width>
4233+
<height>685</height>
42674234
</rect>
42684235
</property>
42694236
<layout class="QVBoxLayout" name="verticalLayout_33">

0 commit comments

Comments
 (0)
Please sign in to comment.