mirror of
https://github.com/qgis/QGIS.git
synced 2025-03-31 00:03:42 -04:00
#8725: use default drawing config
This commit is contained in:
parent
d2d8e4f783
commit
7b3761415b
@ -523,6 +523,11 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WFlags fl ) :
|
||||
chkAntiAliasing->setChecked( settings.value( "/qgis/enable_anti_aliasing", true ).toBool() );
|
||||
chkUseRenderCaching->setChecked( settings.value( "/qgis/enable_render_caching", false ).toBool() );
|
||||
|
||||
// Default simplify drawing configuration
|
||||
mSimplifyDrawingGroupBox->setChecked( settings.value( "/qgis/simplifyDrawingHints", (int)QgsVectorLayer::FullSimplification ).toInt() != QgsVectorLayer::NoSimplification );
|
||||
mSimplifyDrawingSlider->setValue( (int)(5.0f * (settings.value( "/qgis/simplifyDrawingTol", 1.0F ).toFloat()-1)) );
|
||||
mSimplifyDrawingPanel->setVisible( mSimplifyDrawingSlider->value()>0 );
|
||||
|
||||
// Slightly awkard here at the settings value is true to use QImage,
|
||||
// but the checkbox is true to use QPixmap
|
||||
chkUseQPixmap->setChecked( !( settings.value( "/qgis/use_qimage_to_render", true ).toBool() ) );
|
||||
@ -980,6 +985,10 @@ void QgsOptions::saveOptions()
|
||||
bool legendLayersCapitalise = settings.value( "/qgis/capitaliseLayerName", false ).toBool();
|
||||
settings.setValue( "/qgis/capitaliseLayerName", capitaliseCheckBox->isChecked() );
|
||||
|
||||
// Default simplify drawing configuration
|
||||
settings.setValue( "/qgis/simplifyDrawingHints", (int)(mSimplifyDrawingGroupBox->isChecked() ? QgsVectorLayer::FullSimplification : QgsVectorLayer::NoSimplification) );
|
||||
settings.setValue( "/qgis/simplifyDrawingTol", (float)(1.0f + 0.2f*mSimplifyDrawingSlider->value()) );
|
||||
|
||||
// project
|
||||
settings.setValue( "/qgis/projOpenAtLaunch", mProjectOnLaunchCmbBx->currentIndex() );
|
||||
settings.setValue( "/qgis/projOpenAtLaunchPath", mProjectOnLaunchLineEdit->text() );
|
||||
@ -1850,3 +1859,7 @@ void QgsOptions::saveContrastEnhancement( QComboBox *cbox, QString name )
|
||||
settings.setValue( "/Raster/defaultContrastEnhancementAlgorithm/" + name, value );
|
||||
}
|
||||
|
||||
void QgsOptions::on_mSimplifyDrawingSlider_valueChanged( int value )
|
||||
{
|
||||
mSimplifyDrawingPanel->setVisible( value>0 );
|
||||
}
|
||||
|
@ -227,6 +227,8 @@ class APP_EXPORT QgsOptions : public QgsOptionsDialogBase, private Ui::QgsOption
|
||||
*/
|
||||
void saveGdalDriverList();
|
||||
|
||||
void on_mSimplifyDrawingSlider_valueChanged( int value );
|
||||
|
||||
private:
|
||||
QStringList i18nList();
|
||||
void initContrastEnhancement( QComboBox *cbox, QString name, QString defaultVal );
|
||||
|
@ -181,6 +181,12 @@ QgsVectorLayer::QgsVectorLayer( QString vectorLayerPath,
|
||||
connect( this, SIGNAL( selectionChanged( QgsFeatureIds, QgsFeatureIds, bool ) ), this, SIGNAL( selectionChanged() ) );
|
||||
|
||||
connect( QgsProject::instance()->relationManager(), SIGNAL( relationsLoaded() ), this, SLOT( onRelationsLoaded() ) );
|
||||
|
||||
// Default simplify drawing configuration
|
||||
QSettings settings;
|
||||
setSimplifyDrawingHints( settings.value( "/qgis/simplifyDrawingHints", (int)mSimplifyDrawingHints ).toInt() );
|
||||
setSimplifyDrawingTol( settings.value( "/qgis/simplifyDrawingTol", mSimplifyDrawingTol ).toFloat() );
|
||||
|
||||
} // QgsVectorLayer ctor
|
||||
|
||||
|
||||
|
@ -1649,6 +1649,182 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="0">
|
||||
<widget class="QGroupBox" name="mSimplifyDrawingGroupBox">
|
||||
<property name="title">
|
||||
<string>By default simplify geometries</string>
|
||||
</property>
|
||||
<property name="checkable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="_14">
|
||||
<item row="0" column="2" colspan="3">
|
||||
<widget class="QLabel" name="label_59">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">By default new vector layers added to the map should simplify geometries to improve rendering speed. The simplification applies only during rendering of the layer and does not modify the layer geometry.</p></body></html></string>
|
||||
</property>
|
||||
<property name="wordWrap">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="2">
|
||||
<widget class="QLabel" name="label_56">
|
||||
<property name="text">
|
||||
<string>Simplification factor (higher values result in more simplification): </string>
|
||||
</property>
|
||||
<property name="margin">
|
||||
<number>2</number>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="3">
|
||||
<widget class="QSlider" name="mSimplifyDrawingSlider">
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>130</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
<string>Higher values result in more simplification</string>
|
||||
</property>
|
||||
<property name="minimum">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="maximum">
|
||||
<number>20</number>
|
||||
</property>
|
||||
<property name="value">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="tracking">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="invertedAppearance">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="invertedControls">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="8" column="2" colspan="2">
|
||||
<widget class="QFrame" name="mSimplifyDrawingPanel">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>0</width>
|
||||
<height>70</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>16777215</width>
|
||||
<height>16777215</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="frameShape">
|
||||
<enum>QFrame::Box</enum>
|
||||
</property>
|
||||
<property name="frameShadow">
|
||||
<enum>QFrame::Raised</enum>
|
||||
</property>
|
||||
<widget class="QLabel" name="mSimplifyDrawingIcon">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>10</x>
|
||||
<y>0</y>
|
||||
<width>60</width>
|
||||
<height>67</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
<height>67</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>40</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="layoutDirection">
|
||||
<enum>Qt::LeftToRight</enum>
|
||||
</property>
|
||||
<property name="autoFillBackground">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="pixmap">
|
||||
<pixmap resource="../../images/images.qrc">:/images/themes/default/mIconWarn.png</pixmap>
|
||||
</property>
|
||||
<property name="scaledContents">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="mSimplifyDrawingLabel">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>45</x>
|
||||
<y>8</y>
|
||||
<width>411</width>
|
||||
<height>51</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd">
|
||||
<html><head><meta name="qrichtext" content="1" /><style type="text/css">
|
||||
p, li { white-space: pre-wrap; }
|
||||
</style></head><body style=" font-family:'MS Shell Dlg 2'; font-size:8.25pt; font-weight:400; font-style:normal;">
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> </span><span style=" font-size:8pt; font-weight:600;">Warning:</span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> Increasing this factor will further speed up rendering, but may result in gaps </span></p>
|
||||
<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-size:8pt;"> or topological errors in the layer display.</span></p></body></html></string>
|
||||
</property>
|
||||
</widget>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="5" column="4">
|
||||
<spacer name="horizontalSpacer_40">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
@ -3858,7 +4034,7 @@
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_34">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_35">
|
||||
<item>
|
||||
<widget class="QLabel" name="lblUserAgent">
|
||||
<property name="text">
|
||||
|
Loading…
x
Reference in New Issue
Block a user