Skip to content

Commit

Permalink
#5416 Add map tips delay setting to menu
Browse files Browse the repository at this point in the history
  • Loading branch information
jdugge committed Mar 8, 2018
1 parent 7622ecf commit c30b824
Show file tree
Hide file tree
Showing 3 changed files with 62 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -3815,10 +3815,10 @@ void QgisApp::createMapTips()
mpMapTipsTimer = new QTimer( mMapCanvas );
// connect the timer to the maptips slot
connect( mpMapTipsTimer, &QTimer::timeout, this, &QgisApp::showMapTip );
// set the interval to 0.850 seconds or time defined in Advanced Settings
// set the delay to 0.850 seconds or time defined in the Settings
// timer will be started next time the mouse moves
QgsSettings settings;
int timerInterval = settings.value( "qgis/mapTipsTimerInterval", 850 ).toInt();
int timerInterval = settings.value( "qgis/mapTipsDelay", 850 ).toInt();
mpMapTipsTimer->setInterval( timerInterval );
mpMapTipsTimer->setSingleShot( true );

Expand Down
6 changes: 6 additions & 0 deletions src/app/qgsoptions.cpp
Expand Up @@ -642,6 +642,9 @@ QgsOptions::QgsOptions( QWidget *parent, Qt::WindowFlags fl, const QList<QgsOpti
// WMS getLegendGraphic setting
mLegendGraphicResolutionSpinBox->setValue( mSettings->value( QStringLiteral( "/qgis/defaultLegendGraphicResolution" ), 0 ).toInt() );

// Map Tips delay
mMapTipsDelaySpinBox->setValue( mSettings->value( QStringLiteral( "qgis/mapTipsDelay" ), 850 ).toInt() );

//
// Raster properties
//
Expand Down Expand Up @@ -1233,6 +1236,9 @@ void QgsOptions::saveOptions()
mSettings->setValue( QStringLiteral( "/qgis/addOracleDC" ), cbxAddOracleDC->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/compileExpressions" ), cbxCompileExpressions->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/defaultLegendGraphicResolution" ), mLegendGraphicResolutionSpinBox->value() );
mSettings->setValue( QStringLiteral( "/qgis/mapTipsDelay" ), mMapTipsDelaySpinBox->value() );
bool createRasterLegendIcons = mSettings->value( QStringLiteral( "/qgis/createRasterLegendIcons" ), false ).toBool();
mSettings->setValue( QStringLiteral( "/qgis/createRasterLegendIcons" ), cbxCreateRasterLegendIcons->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/copyFeatureFormat" ), mComboCopyFeatureFormat->currentData().toInt() );

mSettings->setValue( QStringLiteral( "/qgis/new_layers_visible" ), chkAddedVisibility->isChecked() );
Expand Down
54 changes: 54 additions & 0 deletions src/ui/qgsoptionsbase.ui
Expand Up @@ -3073,6 +3073,60 @@
</layout>
</widget>
</item>
<item>
<widget class="QgsCollapsibleGroupBox" name="groupBox_12">
<property name="title">
<string>Map Tips</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_22">
<item>
<widget class="QLabel" name="textLabel1_16">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Delay (ms)</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_39">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeType">
<enum>QSizePolicy::Preferred</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>30</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QSpinBox" name="mMapTipsDelaySpinBox">
<property name="toolTip">
<string extracomment="MAP_RESOLUTION or DPI value overloading getMap default value (set 0 to use default)"/>
</property>
<property name="whatsThis">
<string extracomment="MAP_RESOLUTION or DPI value overloading getMap default value (set 0 to use default)"/>
</property>
<property name="minimum">
<number>0</number>
</property>
<property name="maximum">
<number>1000000</number>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<spacer>
<property name="orientation">
Expand Down

0 comments on commit c30b824

Please sign in to comment.