Skip to content
Permalink
Browse files

[tracing curves] add settings

  • Loading branch information
olivierdalang committed May 11, 2020
1 parent 2ba0702 commit ac9752ce4982f5bc836c002c91f661203d810343
Showing with 23 additions and 1 deletion.
  1. +4 −0 src/app/qgsoptions.cpp
  2. +2 −1 src/gui/qgsmaptoolcapture.cpp
  3. +17 −0 src/ui/qgsoptionsbase.ui
@@ -1110,6 +1110,8 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mOffsetQuadSegSpinBox->setValue( mSettings->value( QStringLiteral( "/qgis/digitizing/offset_quad_seg" ), 8 ).toInt() );
mCurveOffsetMiterLimitComboBox->setValue( mSettings->value( QStringLiteral( "/qgis/digitizing/offset_miter_limit" ), 5.0 ).toDouble() );

mTracingConvertToCurveCheckBox->setChecked( mSettings->value( QStringLiteral( "/qgis/digitizing/convert_to_curve" ), false ).toBool() );

// load gdal driver list only when gdal tab is first opened
mLoadedGdalDriverList = false;

@@ -1713,6 +1715,8 @@ void QgsOptions::saveOptions()
mSettings->setValue( QStringLiteral( "/qgis/digitizing/offset_quad_seg" ), mOffsetQuadSegSpinBox->value() );
mSettings->setValue( QStringLiteral( "/qgis/digitizing/offset_miter_limit" ), mCurveOffsetMiterLimitComboBox->value() );

mSettings->setValue( QStringLiteral( "/qgis/digitizing/convert_to_curve" ), mTracingConvertToCurveCheckBox->isChecked() );

// default scale list
QString myPaths;
for ( int i = 0; i < mListGlobalScales->count(); ++i )
@@ -290,8 +290,9 @@ bool QgsMapToolCapture::tracingAddVertex( const QgsPointXY &point )
}

// If the layer supports curves, we de-approximate curves
QgsSettings settings;
QgsVectorLayer *vlayer = qobject_cast<QgsVectorLayer *>( mCanvas->currentLayer() );
if ( vlayer->dataProvider()->capabilities().testFlag( QgsVectorDataProvider::Capability::CircularGeometries ) )
if ( vlayer->dataProvider()->capabilities().testFlag( QgsVectorDataProvider::Capability::CircularGeometries ) && settings.value( QStringLiteral( "/qgis/digitizing/convert_to_curve" ), false ).toBool() )
{
QgsGeometry linear = QgsGeometry( mCaptureCurve.segmentize() );
QgsGeometry curved = linear.convertToCurves();
@@ -4506,6 +4506,22 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
</layout>
</widget>
</item>
<item>
<widget class="QgsCollapsibleGroupBox" name="groupBox_30">
<property name="title">
<string>Tracing</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0" colspan="3">
<widget class="QCheckBox" name="mTracingConvertToCurveCheckBox">
<property name="text">
<string>Convert tracing to curve</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer name="verticalSpacer_4">
<property name="orientation">
@@ -5836,6 +5852,7 @@ p, li { white-space: pre-wrap; }
<tabstop>mOffsetJoinStyleComboBox</tabstop>
<tabstop>mOffsetQuadSegSpinBox</tabstop>
<tabstop>mCurveOffsetMiterLimitComboBox</tabstop>
<tabstop>mTracingConvertToCurveCheckBox</tabstop>
<tabstop>mOptionsScrollArea_12</tabstop>
<tabstop>mComposerFontComboBox</tabstop>
<tabstop>mGridStyleComboBox</tabstop>

0 comments on commit ac9752c

Please sign in to comment.
You can’t perform that action at this time.