Skip to content

Commit

Permalink
Merge pull request #40200 from qgis-bot/backport-40184-to-release-3_16
Browse files Browse the repository at this point in the history
[Backport release-3_16] [curves tracing] expose settings for tracing curves in the UI
  • Loading branch information
m-kuhn committed Nov 20, 2020
2 parents 4447d78 + a7dc1a9 commit d01c9bd
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 45 deletions.
6 changes: 6 additions & 0 deletions src/app/options/qgsoptions.cpp
Expand Up @@ -1160,6 +1160,10 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
mCurveOffsetMiterLimitComboBox->setClearValue( 5.0 ); mCurveOffsetMiterLimitComboBox->setClearValue( 5.0 );


mTracingConvertToCurveCheckBox->setChecked( mSettings->value( QStringLiteral( "/qgis/digitizing/convert_to_curve" ), false ).toBool() ); mTracingConvertToCurveCheckBox->setChecked( mSettings->value( QStringLiteral( "/qgis/digitizing/convert_to_curve" ), false ).toBool() );
mTracingCustomAngleToleranceSpinBox->setValue( mSettings->value( QStringLiteral( "/qgis/digitizing/convert_to_curve_angle_tolerance" ), 1e-6 ).toDouble() );
mTracingCustomAngleToleranceSpinBox->setClearValue( 1e-6 );
mTracingCustomDistanceToleranceSpinBox->setValue( mSettings->value( QStringLiteral( "/qgis/digitizing/convert_to_curve_distance_tolerance" ), 1e-6 ).toDouble() );
mTracingCustomDistanceToleranceSpinBox->setClearValue( 1e-6 );


// load gdal driver list only when gdal tab is first opened // load gdal driver list only when gdal tab is first opened
mLoadedGdalDriverList = false; mLoadedGdalDriverList = false;
Expand Down Expand Up @@ -1782,6 +1786,8 @@ void QgsOptions::saveOptions()
mSettings->setValue( QStringLiteral( "/qgis/digitizing/offset_miter_limit" ), mCurveOffsetMiterLimitComboBox->value() ); mSettings->setValue( QStringLiteral( "/qgis/digitizing/offset_miter_limit" ), mCurveOffsetMiterLimitComboBox->value() );


mSettings->setValue( QStringLiteral( "/qgis/digitizing/convert_to_curve" ), mTracingConvertToCurveCheckBox->isChecked() ); mSettings->setValue( QStringLiteral( "/qgis/digitizing/convert_to_curve" ), mTracingConvertToCurveCheckBox->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/digitizing/convert_to_curve_angle_tolerance" ), mTracingCustomAngleToleranceSpinBox->value() );
mSettings->setValue( QStringLiteral( "/qgis/digitizing/convert_to_curve_distance_tolerance" ), mTracingCustomDistanceToleranceSpinBox->value() );


// default scale list // default scale list
QString myPaths; QString myPaths;
Expand Down
132 changes: 87 additions & 45 deletions src/ui/qgsoptionsbase.ui
Expand Up @@ -7,7 +7,7 @@
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>1029</width> <width>1029</width>
<height>730</height> <height>744</height>
</rect> </rect>
</property> </property>
<property name="minimumSize"> <property name="minimumSize">
Expand Down Expand Up @@ -332,7 +332,7 @@
<item> <item>
<widget class="QStackedWidget" name="mOptionsStackedWidget"> <widget class="QStackedWidget" name="mOptionsStackedWidget">
<property name="currentIndex"> <property name="currentIndex">
<number>0</number> <number>9</number>
</property> </property>
<widget class="QWidget" name="mOptionsPageGeneral"> <widget class="QWidget" name="mOptionsPageGeneral">
<layout class="QVBoxLayout" name="verticalLayout_3"> <layout class="QVBoxLayout" name="verticalLayout_3">
Expand Down Expand Up @@ -361,8 +361,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>843</width> <width>846</width>
<height>1019</height> <height>743</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_28"> <layout class="QVBoxLayout" name="verticalLayout_28">
Expand Down Expand Up @@ -1133,8 +1133,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>843</width> <width>846</width>
<height>1084</height> <height>940</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_22"> <layout class="QVBoxLayout" name="verticalLayout_22">
Expand Down Expand Up @@ -1672,8 +1672,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>857</width> <width>861</width>
<height>679</height> <height>691</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_15"> <layout class="QGridLayout" name="gridLayout_15">
Expand Down Expand Up @@ -1864,8 +1864,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>857</width> <width>861</width>
<height>679</height> <height>691</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_47"> <layout class="QVBoxLayout" name="verticalLayout_47">
Expand Down Expand Up @@ -1947,8 +1947,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>843</width> <width>861</width>
<height>804</height> <height>691</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_27"> <layout class="QVBoxLayout" name="verticalLayout_27">
Expand Down Expand Up @@ -2356,8 +2356,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>843</width> <width>846</width>
<height>1198</height> <height>844</height>
</rect> </rect>
</property> </property>
<layout class="QGridLayout" name="gridLayout_22"> <layout class="QGridLayout" name="gridLayout_22">
Expand Down Expand Up @@ -3161,8 +3161,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>857</width> <width>861</width>
<height>679</height> <height>691</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_25"> <layout class="QVBoxLayout" name="verticalLayout_25">
Expand Down Expand Up @@ -3371,15 +3371,15 @@
<property name="whatsThis"> <property name="whatsThis">
<string extracomment="MAP_RESOLUTION or DPI value overloading getMap default value (set 0 to use default)"/> <string extracomment="MAP_RESOLUTION or DPI value overloading getMap default value (set 0 to use default)"/>
</property> </property>
<property name="suffix">
<string> dpi</string>
</property>
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<number>1000000</number> <number>1000000</number>
</property> </property>
<property name="suffix">
<string> dpi</string>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
Expand Down Expand Up @@ -3417,27 +3417,27 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="toolTip">
<string extracomment="(set value to 0 to skip minimum size)"/>
</property>
<property name="suffix"> <property name="suffix">
<string> mm</string> <string> mm</string>
</property> </property>
<property name="decimals"> <property name="decimals">
<number>2</number> <number>2</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>999.00</double> <double>999.000000000000000</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.200000000000000</double> <double>0.200000000000000</double>
</property> </property>
<property name="value"> <property name="value">
<double>0.10</double> <double>0.100000000000000</double>
</property> </property>
<property name="showClearButton" stdset="0"> <property name="showClearButton" stdset="0">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="toolTip">
<string extracomment="(set value to 0 to skip minimum size)"/>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
Expand Down Expand Up @@ -3475,27 +3475,27 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="toolTip">
<string extracomment="(set value to 0 to skip maximum size)"/>
</property>
<property name="suffix"> <property name="suffix">
<string> mm</string> <string> mm</string>
</property> </property>
<property name="decimals"> <property name="decimals">
<number>2</number> <number>2</number>
</property> </property>
<property name="maximum"> <property name="maximum">
<double>999.00</double> <double>999.000000000000000</double>
</property> </property>
<property name="singleStep"> <property name="singleStep">
<double>0.200000000000000</double> <double>0.200000000000000</double>
</property> </property>
<property name="value"> <property name="value">
<double>20.00</double> <double>20.000000000000000</double>
</property> </property>
<property name="showClearButton" stdset="0"> <property name="showClearButton" stdset="0">
<bool>true</bool> <bool>true</bool>
</property> </property>
<property name="toolTip">
<string extracomment="(set value to 0 to skip maximum size)"/>
</property>
</widget> </widget>
</item> </item>
</layout> </layout>
Expand Down Expand Up @@ -3540,15 +3540,15 @@
</item> </item>
<item> <item>
<widget class="QgsSpinBox" name="mMapTipsDelaySpinBox"> <widget class="QgsSpinBox" name="mMapTipsDelaySpinBox">
<property name="suffix">
<string> ms</string>
</property>
<property name="toolTip"> <property name="toolTip">
<string extracomment="MAP_RESOLUTION or DPI value overloading getMap default value (set 0 to use default)"/> <string extracomment="MAP_RESOLUTION or DPI value overloading getMap default value (set 0 to use default)"/>
</property> </property>
<property name="whatsThis"> <property name="whatsThis">
<string extracomment="MAP_RESOLUTION or DPI value overloading getMap default value (set 0 to use default)"/> <string extracomment="MAP_RESOLUTION or DPI value overloading getMap default value (set 0 to use default)"/>
</property> </property>
<property name="suffix">
<string> ms</string>
</property>
<property name="minimum"> <property name="minimum">
<number>0</number> <number>0</number>
</property> </property>
Expand Down Expand Up @@ -3606,8 +3606,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>843</width> <width>861</width>
<height>709</height> <height>691</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_30"> <layout class="QVBoxLayout" name="verticalLayout_30">
Expand Down Expand Up @@ -4123,8 +4123,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>857</width> <width>861</width>
<height>679</height> <height>691</height>
</rect> </rect>
</property> </property>
<layout class="QHBoxLayout" name="horizontalLayout_46"> <layout class="QHBoxLayout" name="horizontalLayout_46">
Expand Down Expand Up @@ -4303,8 +4303,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>843</width> <width>846</width>
<height>956</height> <height>714</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_31"> <layout class="QVBoxLayout" name="verticalLayout_31">
Expand Down Expand Up @@ -4888,6 +4888,46 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="1" column="0">
<widget class="QLabel" name="label_44">
<property name="text">
<string>Angle tolerance when tracing curves</string>
</property>
</widget>
</item>
<item row="2" column="0">
<widget class="QLabel" name="label_70">
<property name="text">
<string>Distance tolerance when tracing curves</string>
</property>
</widget>
</item>
<item row="1" column="2">
<widget class="QgsDoubleSpinBox" name="mTracingCustomAngleToleranceSpinBox">
<property name="toolTip">
<string>This specifies the maximum angular deviation (in radians) allowed for a series of points to be converted to a curve.</string>
</property>
<property name="decimals">
<number>10</number>
</property>
<property name="maximum">
<double>9999.000000000000000</double>
</property>
</widget>
</item>
<item row="2" column="2">
<widget class="QgsDoubleSpinBox" name="mTracingCustomDistanceToleranceSpinBox">
<property name="toolTip">
<string>This specifies the maximum deviation allowed between the original location of vertices and where they would fall on the candidate curved geometry for a series of points to be converted to a curve.</string>
</property>
<property name="decimals">
<number>10</number>
</property>
<property name="maximum">
<double>9999.000000000000000</double>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>
Expand Down Expand Up @@ -4937,8 +4977,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>857</width> <width>861</width>
<height>679</height> <height>691</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_39"> <layout class="QVBoxLayout" name="verticalLayout_39">
Expand Down Expand Up @@ -5218,8 +5258,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>857</width> <width>861</width>
<height>679</height> <height>691</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_6"> <layout class="QVBoxLayout" name="verticalLayout_6">
Expand Down Expand Up @@ -5490,8 +5530,8 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>843</width> <width>437</width>
<height>699</height> <height>513</height>
</rect> </rect>
</property> </property>
<layout class="QVBoxLayout" name="verticalLayout_33"> <layout class="QVBoxLayout" name="verticalLayout_33">
Expand Down Expand Up @@ -5971,7 +6011,7 @@ The bigger the number, the faster zooming with the mouse wheel will be.</string>
<string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt; <string>&lt;!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.0//EN&quot; &quot;http://www.w3.org/TR/REC-html40/strict.dtd&quot;&gt;
&lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt; &lt;html&gt;&lt;head&gt;&lt;meta name=&quot;qrichtext&quot; content=&quot;1&quot; /&gt;&lt;style type=&quot;text/css&quot;&gt;
p, li { white-space: pre-wrap; } p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Fira Sans'; font-size:11pt; font-weight:400; font-style:normal;&quot;&gt; &lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.14286pt; font-weight:400; font-style:normal;&quot;&gt;
&lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Noto Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string> &lt;p style=&quot;-qt-paragraph-type:empty; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px; font-family:'Noto Sans'; font-size:10pt;&quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property> </property>
</widget> </widget>
Expand Down Expand Up @@ -6337,6 +6377,8 @@ p, li { white-space: pre-wrap; }
<tabstop>mOffsetQuadSegSpinBox</tabstop> <tabstop>mOffsetQuadSegSpinBox</tabstop>
<tabstop>mCurveOffsetMiterLimitComboBox</tabstop> <tabstop>mCurveOffsetMiterLimitComboBox</tabstop>
<tabstop>mTracingConvertToCurveCheckBox</tabstop> <tabstop>mTracingConvertToCurveCheckBox</tabstop>
<tabstop>mTracingCustomAngleToleranceSpinBox</tabstop>
<tabstop>mTracingCustomDistanceToleranceSpinBox</tabstop>
<tabstop>mOptionsScrollArea_12</tabstop> <tabstop>mOptionsScrollArea_12</tabstop>
<tabstop>mComposerFontComboBox</tabstop> <tabstop>mComposerFontComboBox</tabstop>
<tabstop>mGridStyleComboBox</tabstop> <tabstop>mGridStyleComboBox</tabstop>
Expand Down

0 comments on commit d01c9bd

Please sign in to comment.