Skip to content

Commit 319acc2

Browse files
ahuarte47m-kuhn
authored andcommitted
#8725-R: show map2pixel threshold in panels
1 parent 0a970eb commit 319acc2

4 files changed

+178
-154
lines changed

src/app/qgsoptions.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -565,6 +565,7 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
565565
mSimplifyDrawingGroupBox->setChecked( settings.value( "/qgis/simplifyDrawingHints", ( int )QgsVectorLayer::DefaultSimplification ).toInt() != QgsVectorLayer::NoSimplification );
566566
mSimplifyDrawingSlider->setValue(( int )( 5.0f * ( settings.value( "/qgis/simplifyDrawingTol", QGis::DEFAULT_MAPTOPIXEL_THRESHOLD ).toFloat() - 1 ) ) );
567567
mSimplifyDrawingPanel->setVisible( mSimplifyDrawingSlider->value() > 0 );
568+
mSimplifyDrawingPx->setText( QString( "(%1 px)" ).arg( 1.0f + 0.2f * mSimplifyDrawingSlider->value() ) );
568569

569570
// Slightly awkard here at the settings value is true to use QImage,
570571
// but the checkbox is true to use QPixmap
@@ -2088,5 +2089,6 @@ void QgsOptions::saveDefaultDatumTransformations()
20882089
void QgsOptions::on_mSimplifyDrawingSlider_valueChanged( int value )
20892090
{
20902091
mSimplifyDrawingPanel->setVisible( value > 0 );
2092+
mSimplifyDrawingPx->setText( QString( "(%1 px)" ).arg( 1.0f + 0.2f * value ) );
20912093
}
20922094

src/app/qgsvectorlayerproperties.cpp

+2
Original file line numberDiff line numberDiff line change
@@ -396,6 +396,7 @@ void QgsVectorLayerProperties::syncToLayer( void )
396396
mSimplifyDrawingGroupBox->setChecked( layer->simplifyDrawingHints() != QgsVectorLayer::NoSimplification );
397397
mSimplifyDrawingSlider->setValue(( int )( 5.0f * ( layer->simplifyDrawingTol() - 1 ) ) );
398398
mSimplifyDrawingPanel->setVisible( mSimplifyDrawingSlider->value() > 0 );
399+
mSimplifyDrawingPx->setText( QString( "(%1 px)" ).arg( 1.0f + 0.2f * mSimplifyDrawingSlider->value() ) );
399400

400401
// load appropriate symbology page (V1 or V2)
401402
updateSymbologyPage();
@@ -1086,4 +1087,5 @@ void QgsVectorLayerProperties::on_mMaximumScaleSetCurrentPushButton_clicked()
10861087
void QgsVectorLayerProperties::on_mSimplifyDrawingSlider_valueChanged( int value )
10871088
{
10881089
mSimplifyDrawingPanel->setVisible( value > 0 );
1090+
mSimplifyDrawingPx->setText( QString( "(%1 px)" ).arg( 1.0f + 0.2f * value ) );
10891091
}

src/ui/qgsoptionsbase.ui

+161-151
Original file line numberDiff line numberDiff line change
@@ -1681,182 +1681,192 @@
16811681
</property>
16821682
</widget>
16831683
</item>
1684-
<item row="5" column="0">
1685-
<widget class="QGroupBox" name="mSimplifyDrawingGroupBox">
1686-
<property name="title">
1687-
<string>Simplify geometries by default</string>
1688-
</property>
1689-
<property name="checkable">
1690-
<bool>true</bool>
1691-
</property>
1692-
<layout class="QGridLayout" name="_14">
1693-
<item row="0" column="2" colspan="3">
1694-
<widget class="QLabel" name="label_59">
1695-
<property name="sizePolicy">
1696-
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
1697-
<horstretch>0</horstretch>
1698-
<verstretch>0</verstretch>
1699-
</sizepolicy>
1700-
</property>
1701-
<property name="text">
1702-
<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;
1684+
<item row="5" column="0">
1685+
<widget class="QGroupBox" name="mSimplifyDrawingGroupBox">
1686+
<property name="title">
1687+
<string>Simplify geometries by default</string>
1688+
</property>
1689+
<property name="checkable">
1690+
<bool>true</bool>
1691+
</property>
1692+
<layout class="QGridLayout" name="_14">
1693+
<item row="0" column="2" colspan="3">
1694+
<widget class="QLabel" name="label_59">
1695+
<property name="sizePolicy">
1696+
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
1697+
<horstretch>0</horstretch>
1698+
<verstretch>0</verstretch>
1699+
</sizepolicy>
1700+
</property>
1701+
<property name="text">
1702+
<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;
17031703
&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;
17041704
p, li { white-space: pre-wrap; }
17051705
&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;
17061706
&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;If checked, new vector layers added to the map will automatically use geometry simplification to speed up rendering. The simplification applies only during rendering of the layer and does not modify the layer geometry.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1707-
</property>
1708-
<property name="wordWrap">
1709-
<bool>true</bool>
1710-
</property>
1711-
<property name="margin">
1712-
<number>2</number>
1713-
</property>
1714-
</widget>
1715-
</item>
1716-
<item row="5" column="2">
1717-
<widget class="QLabel" name="label_56">
1718-
<property name="text">
1719-
<string>Simplification factor (higher values result in more simplification): </string>
1720-
</property>
1721-
<property name="margin">
1722-
<number>2</number>
1723-
</property>
1724-
</widget>
1725-
</item>
1726-
<item row="5" column="3">
1727-
<widget class="QSlider" name="mSimplifyDrawingSlider">
1728-
<property name="maximumSize">
1729-
<size>
1730-
<width>130</width>
1731-
<height>16777215</height>
1732-
</size>
1733-
</property>
1734-
<property name="toolTip">
1735-
<string>Higher values result in more simplification</string>
1736-
</property>
1737-
<property name="minimum">
1738-
<number>0</number>
1739-
</property>
1740-
<property name="maximum">
1741-
<number>20</number>
1742-
</property>
1743-
<property name="value">
1744-
<number>0</number>
1745-
</property>
1746-
<property name="tracking">
1747-
<bool>true</bool>
1748-
</property>
1749-
<property name="orientation">
1750-
<enum>Qt::Horizontal</enum>
1751-
</property>
1752-
<property name="invertedAppearance">
1753-
<bool>false</bool>
1754-
</property>
1755-
<property name="invertedControls">
1756-
<bool>false</bool>
1757-
</property>
1758-
</widget>
1759-
</item>
1760-
<item row="8" column="2" colspan="2">
1761-
<widget class="QFrame" name="mSimplifyDrawingPanel">
1762-
<property name="minimumSize">
1763-
<size>
1764-
<width>0</width>
1765-
<height>70</height>
1766-
</size>
1767-
</property>
1768-
<property name="maximumSize">
1769-
<size>
1770-
<width>16777215</width>
1771-
<height>16777215</height>
1772-
</size>
1773-
</property>
1774-
<property name="frameShape">
1775-
<enum>QFrame::Box</enum>
1776-
</property>
1777-
<property name="frameShadow">
1778-
<enum>QFrame::Raised</enum>
1779-
</property>
1780-
<widget class="QLabel" name="mSimplifyDrawingIcon">
1781-
<property name="geometry">
1782-
<rect>
1783-
<x>10</x>
1784-
<y>0</y>
1785-
<width>60</width>
1786-
<height>67</height>
1787-
</rect>
17881707
</property>
1789-
<property name="sizePolicy">
1790-
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
1791-
<horstretch>0</horstretch>
1792-
<verstretch>0</verstretch>
1793-
</sizepolicy>
1708+
<property name="wordWrap">
1709+
<bool>true</bool>
17941710
</property>
1795-
<property name="minimumSize">
1796-
<size>
1797-
<width>60</width>
1798-
<height>67</height>
1799-
</size>
1711+
<property name="margin">
1712+
<number>2</number>
1713+
</property>
1714+
</widget>
1715+
</item>
1716+
<item row="5" column="2">
1717+
<widget class="QLabel" name="label_56">
1718+
<property name="text">
1719+
<string>Simplification threshold (higher values result in more simplification): </string>
18001720
</property>
1721+
<property name="margin">
1722+
<number>2</number>
1723+
</property>
1724+
</widget>
1725+
</item>
1726+
<item row="5" column="3">
1727+
<widget class="QSlider" name="mSimplifyDrawingSlider">
18011728
<property name="maximumSize">
18021729
<size>
1803-
<width>40</width>
1804-
<height>40</height>
1730+
<width>130</width>
1731+
<height>16777215</height>
18051732
</size>
18061733
</property>
1807-
<property name="layoutDirection">
1808-
<enum>Qt::LeftToRight</enum>
1734+
<property name="toolTip">
1735+
<string>Higher values result in more simplification</string>
18091736
</property>
1810-
<property name="autoFillBackground">
1811-
<bool>false</bool>
1737+
<property name="minimum">
1738+
<number>0</number>
18121739
</property>
1813-
<property name="text">
1814-
<string/>
1740+
<property name="maximum">
1741+
<number>20</number>
18151742
</property>
1816-
<property name="pixmap">
1817-
<pixmap resource="../../images/images.qrc">:/images/themes/default/mIconWarn.png</pixmap>
1743+
<property name="value">
1744+
<number>0</number>
1745+
</property>
1746+
<property name="tracking">
1747+
<bool>true</bool>
18181748
</property>
1819-
<property name="scaledContents">
1749+
<property name="orientation">
1750+
<enum>Qt::Horizontal</enum>
1751+
</property>
1752+
<property name="invertedAppearance">
18201753
<bool>false</bool>
18211754
</property>
1822-
</widget>
1823-
<widget class="QLabel" name="mSimplifyDrawingLabel">
1824-
<property name="geometry">
1825-
<rect>
1826-
<x>45</x>
1827-
<y>8</y>
1828-
<width>411</width>
1829-
<height>51</height>
1830-
</rect>
1755+
<property name="invertedControls">
1756+
<bool>false</bool>
18311757
</property>
1758+
</widget>
1759+
</item>
1760+
<item row="5" column="4">
1761+
<widget class="QLabel" name="mSimplifyDrawingPx">
18321762
<property name="text">
1833-
<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;
1763+
<string>(0 px)</string>
1764+
</property>
1765+
<property name="margin">
1766+
<number>2</number>
1767+
</property>
1768+
</widget>
1769+
</item>
1770+
<item row="8" column="2" colspan="3">
1771+
<widget class="QFrame" name="mSimplifyDrawingPanel">
1772+
<property name="minimumSize">
1773+
<size>
1774+
<width>0</width>
1775+
<height>70</height>
1776+
</size>
1777+
</property>
1778+
<property name="maximumSize">
1779+
<size>
1780+
<width>16777215</width>
1781+
<height>16777215</height>
1782+
</size>
1783+
</property>
1784+
<property name="frameShape">
1785+
<enum>QFrame::Box</enum>
1786+
</property>
1787+
<property name="frameShadow">
1788+
<enum>QFrame::Raised</enum>
1789+
</property>
1790+
<widget class="QLabel" name="mSimplifyDrawingIcon">
1791+
<property name="geometry">
1792+
<rect>
1793+
<x>10</x>
1794+
<y>0</y>
1795+
<width>60</width>
1796+
<height>67</height>
1797+
</rect>
1798+
</property>
1799+
<property name="sizePolicy">
1800+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
1801+
<horstretch>0</horstretch>
1802+
<verstretch>0</verstretch>
1803+
</sizepolicy>
1804+
</property>
1805+
<property name="minimumSize">
1806+
<size>
1807+
<width>60</width>
1808+
<height>67</height>
1809+
</size>
1810+
</property>
1811+
<property name="maximumSize">
1812+
<size>
1813+
<width>40</width>
1814+
<height>40</height>
1815+
</size>
1816+
</property>
1817+
<property name="layoutDirection">
1818+
<enum>Qt::LeftToRight</enum>
1819+
</property>
1820+
<property name="autoFillBackground">
1821+
<bool>false</bool>
1822+
</property>
1823+
<property name="text">
1824+
<string/>
1825+
</property>
1826+
<property name="pixmap">
1827+
<pixmap resource="../../images/images.qrc">:/images/themes/default/mIconWarn.png</pixmap>
1828+
</property>
1829+
<property name="scaledContents">
1830+
<bool>false</bool>
1831+
</property>
1832+
</widget>
1833+
<widget class="QLabel" name="mSimplifyDrawingLabel">
1834+
<property name="geometry">
1835+
<rect>
1836+
<x>45</x>
1837+
<y>8</y>
1838+
<width>411</width>
1839+
<height>51</height>
1840+
</rect>
1841+
</property>
1842+
<property name="text">
1843+
<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;
18341844
&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;
18351845
p, li { white-space: pre-wrap; }
18361846
&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;
18371847
&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; &lt;/span&gt;&lt;span style=&quot; font-size:8pt; font-weight:600;&quot;&gt;Warning:&lt;/span&gt;&lt;/p&gt;
1838-
&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; Increasing this factor will further speed up rendering, but may result in gaps &lt;/span&gt;&lt;/p&gt;
1848+
&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; Increasing this threshold may speed up rendering, but may result in gaps &lt;/span&gt;&lt;/p&gt;
18391849
&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; or topological errors in the layer display.&lt;/span&gt;&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
1840-
</property>
1850+
</property>
1851+
</widget>
18411852
</widget>
1842-
</widget>
1843-
</item>
1844-
<item row="5" column="4">
1845-
<spacer name="horizontalSpacer_40">
1846-
<property name="orientation">
1847-
<enum>Qt::Horizontal</enum>
1848-
</property>
1849-
<property name="sizeHint" stdset="0">
1850-
<size>
1851-
<width>20</width>
1852-
<height>20</height>
1853-
</size>
1854-
</property>
1855-
</spacer>
1856-
</item>
1857-
</layout>
1858-
</widget>
1859-
</item>
1853+
</item>
1854+
<item row="5" column="4">
1855+
<spacer name="horizontalSpacer_40">
1856+
<property name="orientation">
1857+
<enum>Qt::Horizontal</enum>
1858+
</property>
1859+
<property name="sizeHint" stdset="0">
1860+
<size>
1861+
<width>20</width>
1862+
<height>20</height>
1863+
</size>
1864+
</property>
1865+
</spacer>
1866+
</item>
1867+
</layout>
1868+
</widget>
1869+
</item>
18601870
</layout>
18611871
</widget>
18621872
</item>

0 commit comments

Comments
 (0)