Skip to content

Commit b42d87b

Browse files
committed
#8725: Show warning label for big simplify factor
1 parent 3442789 commit b42d87b

3 files changed

+191
-86
lines changed

src/app/qgsvectorlayerproperties.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -395,6 +395,7 @@ void QgsVectorLayerProperties::syncToLayer( void )
395395
// get simplify drawing configuration
396396
mSimplifyDrawingGroupBox->setChecked( layer->simplifyDrawingHints() != QgsVectorLayer::NoSimplification );
397397
mSimplifyDrawingSlider->setValue( (int)(5.0f * (layer->simplifyDrawingTol()-1)) );
398+
mSimplifyDrawingPanel->setVisible( mSimplifyDrawingSlider->value()>0 );
398399

399400
// load appropriate symbology page (V1 or V2)
400401
updateSymbologyPage();
@@ -1075,3 +1076,8 @@ void QgsVectorLayerProperties::on_mMaximumScaleSetCurrentPushButton_clicked()
10751076
{
10761077
cbMaximumScale->setScale( 1.0 / QgisApp::instance()->mapCanvas()->mapRenderer()->scale() );
10771078
}
1079+
1080+
void QgsVectorLayerProperties::on_mSimplifyDrawingSlider_valueChanged( int value )
1081+
{
1082+
mSimplifyDrawingPanel->setVisible( value>0 );
1083+
}

src/app/qgsvectorlayerproperties.h

+2
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,8 @@ class APP_EXPORT QgsVectorLayerProperties : public QgsOptionsDialogBase, private
119119
void on_mMinimumScaleSetCurrentPushButton_clicked();
120120
void on_mMaximumScaleSetCurrentPushButton_clicked();
121121

122+
void on_mSimplifyDrawingSlider_valueChanged( int value );
123+
122124
signals:
123125

124126
/** emitted when changes to layer were saved to update legend */

src/ui/qgsvectorlayerpropertiesbase.ui

+183-86
Original file line numberDiff line numberDiff line change
@@ -940,92 +940,189 @@
940940
</rect>
941941
</property>
942942
<layout class="QVBoxLayout" name="verticalLayout_32">
943-
<item>
944-
<widget class="QGroupBox" name="mSimplifyDrawingGroupBox">
945-
<property name="title">
946-
<string>Fast drawing</string>
947-
</property>
948-
<property name="checkable">
949-
<bool>true</bool>
950-
</property>
951-
<layout class="QGridLayout" name="_12">
952-
<item row="0" column="1" colspan="5">
953-
<widget class="QLabel" name="label_16">
954-
<property name="sizePolicy">
955-
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
956-
<horstretch>0</horstretch>
957-
<verstretch>0</verstretch>
958-
</sizepolicy>
959-
</property>
960-
<property name="text">
961-
<string>&lt;b&gt;Note:&lt;/b&gt; This option enables geometry simplification drawing for fast rendering of the layer.</string>
962-
</property>
963-
<property name="margin">
964-
<number>2</number>
965-
</property>
966-
</widget>
967-
</item>
968-
<item row="7" column="1">
969-
<widget class="QLabel" name="label_17">
970-
<property name="text">
971-
<string>Simplification factor (Higher value draws more simplified geometries): </string>
972-
</property>
973-
<property name="margin">
974-
<number>2</number>
975-
</property>
976-
</widget>
977-
</item>
978-
<item row="7" column="2">
979-
<widget class="QSlider" name="mSimplifyDrawingSlider">
980-
<property name="maximumSize">
981-
<size>
982-
<width>100</width>
983-
<height>16777215</height>
984-
</size>
985-
</property>
986-
<property name="toolTip">
987-
<string>Higher value draws more simplified geometries</string>
988-
</property>
989-
<property name="maximum">
990-
<number>20</number>
991-
</property>
992-
<property name="minimum">
993-
<number>0</number>
994-
</property>
995-
<property name="value">
996-
<number>0</number>
997-
</property>
998-
<property name="tracking">
999-
<bool>true</bool>
1000-
</property>
1001-
<property name="orientation">
1002-
<enum>Qt::Horizontal</enum>
1003-
</property>
1004-
<property name="invertedAppearance">
1005-
<bool>false</bool>
1006-
</property>
1007-
<property name="invertedControls">
1008-
<bool>false</bool>
1009-
</property>
1010-
</widget>
1011-
</item>
1012-
<item row="7" column="3">
1013-
<spacer name="horizontalSpacer_6">
1014-
<property name="orientation">
1015-
<enum>Qt::Horizontal</enum>
1016-
</property>
1017-
<property name="sizeHint" stdset="0">
1018-
<size>
1019-
<width>40</width>
1020-
<height>20</height>
1021-
</size>
1022-
</property>
1023-
</spacer>
1024-
</item>
1025-
</layout>
1026-
</widget>
1027-
</item>
1028-
<item>
943+
<item>
944+
<widget class="QGroupBox" name="mSimplifyDrawingGroupBox">
945+
<property name="title">
946+
<string>Fast drawing</string>
947+
</property>
948+
<property name="checkable">
949+
<bool>true</bool>
950+
</property>
951+
<layout class="QGridLayout" name="_12">
952+
<item row="0" column="2" colspan="4">
953+
<widget class="QLabel" name="label_16">
954+
<property name="sizePolicy">
955+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
956+
<horstretch>0</horstretch>
957+
<verstretch>0</verstretch>
958+
</sizepolicy>
959+
</property>
960+
<property name="text">
961+
<string>&lt;b&gt;Note:&lt;/b&gt; This option enables geometry simplification drawing for fast rendering of the layer.</string>
962+
</property>
963+
<property name="margin">
964+
<number>2</number>
965+
</property>
966+
</widget>
967+
</item>
968+
<item row="7" column="2">
969+
<widget class="QLabel" name="label_17">
970+
<property name="text">
971+
<string>Simplification factor (Higher value draws more simplified geometries): </string>
972+
</property>
973+
<property name="margin">
974+
<number>2</number>
975+
</property>
976+
</widget>
977+
</item>
978+
<item row="7" column="3">
979+
<widget class="QSlider" name="mSimplifyDrawingSlider">
980+
<property name="maximumSize">
981+
<size>
982+
<width>100</width>
983+
<height>16777215</height>
984+
</size>
985+
</property>
986+
<property name="toolTip">
987+
<string>Higher value draws more simplified geometries</string>
988+
</property>
989+
<property name="minimum">
990+
<number>0</number>
991+
</property>
992+
<property name="maximum">
993+
<number>20</number>
994+
</property>
995+
<property name="value">
996+
<number>0</number>
997+
</property>
998+
<property name="tracking">
999+
<bool>true</bool>
1000+
</property>
1001+
<property name="orientation">
1002+
<enum>Qt::Horizontal</enum>
1003+
</property>
1004+
<property name="invertedAppearance">
1005+
<bool>false</bool>
1006+
</property>
1007+
<property name="invertedControls">
1008+
<bool>false</bool>
1009+
</property>
1010+
</widget>
1011+
</item>
1012+
<item row="7" column="4">
1013+
<spacer name="horizontalSpacer_6">
1014+
<property name="orientation">
1015+
<enum>Qt::Horizontal</enum>
1016+
</property>
1017+
<property name="sizeHint" stdset="0">
1018+
<size>
1019+
<width>40</width>
1020+
<height>20</height>
1021+
</size>
1022+
</property>
1023+
</spacer>
1024+
</item>
1025+
<item row="10" column="2" colspan="2">
1026+
<widget class="QFrame" name="mSimplifyDrawingPanel">
1027+
<property name="minimumSize">
1028+
<size>
1029+
<width>0</width>
1030+
<height>70</height>
1031+
</size>
1032+
</property>
1033+
<property name="maximumSize">
1034+
<size>
1035+
<width>16777215</width>
1036+
<height>16777215</height>
1037+
</size>
1038+
</property>
1039+
<property name="frameShape">
1040+
<enum>QFrame::Box</enum>
1041+
</property>
1042+
<property name="frameShadow">
1043+
<enum>QFrame::Raised</enum>
1044+
</property>
1045+
<widget class="QLabel" name="mSimplifyDrawingIcon">
1046+
<property name="geometry">
1047+
<rect>
1048+
<x>10</x>
1049+
<y>0</y>
1050+
<width>60</width>
1051+
<height>67</height>
1052+
</rect>
1053+
</property>
1054+
<property name="sizePolicy">
1055+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
1056+
<horstretch>0</horstretch>
1057+
<verstretch>0</verstretch>
1058+
</sizepolicy>
1059+
</property>
1060+
<property name="minimumSize">
1061+
<size>
1062+
<width>60</width>
1063+
<height>67</height>
1064+
</size>
1065+
</property>
1066+
<property name="maximumSize">
1067+
<size>
1068+
<width>40</width>
1069+
<height>40</height>
1070+
</size>
1071+
</property>
1072+
<property name="layoutDirection">
1073+
<enum>Qt::LeftToRight</enum>
1074+
</property>
1075+
<property name="autoFillBackground">
1076+
<bool>false</bool>
1077+
</property>
1078+
<property name="text">
1079+
<string/>
1080+
</property>
1081+
<property name="pixmap">
1082+
<pixmap resource="../../images/images.qrc">:/images/themes/default/mIconWarn.png</pixmap>
1083+
</property>
1084+
<property name="scaledContents">
1085+
<bool>false</bool>
1086+
</property>
1087+
</widget>
1088+
<widget class="QLabel" name="mSimplifyDrawingLabel">
1089+
<property name="geometry">
1090+
<rect>
1091+
<x>45</x>
1092+
<y>8</y>
1093+
<width>391</width>
1094+
<height>51</height>
1095+
</rect>
1096+
</property>
1097+
<property name="text">
1098+
<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;
1099+
&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;
1100+
p, li { white-space: pre-wrap; }
1101+
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;&quot;&gt;
1102+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; Warning:&lt;/span&gt;&lt;/p&gt;
1103+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; Be careful increasing this factor, a further simplification the drawing is faster &lt;/span&gt;&lt;/p&gt;
1104+
&lt;p style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;&lt;span style=&quot; font-size:8pt;&quot;&gt; but may appear topological distortions in the output map (gaps).&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1105+
</property>
1106+
</widget>
1107+
</widget>
1108+
</item>
1109+
<item row="10" column="4">
1110+
<spacer name="horizontalSpacer_7">
1111+
<property name="orientation">
1112+
<enum>Qt::Horizontal</enum>
1113+
</property>
1114+
<property name="sizeHint" stdset="0">
1115+
<size>
1116+
<width>40</width>
1117+
<height>20</height>
1118+
</size>
1119+
</property>
1120+
</spacer>
1121+
</item>
1122+
</layout>
1123+
</widget>
1124+
</item>
1125+
<item>
10291126
<spacer name="verticalSpacer_6">
10301127
<property name="orientation">
10311128
<enum>Qt::Vertical</enum>

0 commit comments

Comments
 (0)