Skip to content
Permalink
Browse files

Merge pull request #5416 from jdugge/mapTipsDelaySetting

[FEATURE] Make map tips delay configurable
  • Loading branch information
m-kuhn committed Apr 25, 2018
2 parents ade216d + 8be522f commit ccc1ac12d54099862823cecee0104fcf0a639075
Showing with 71 additions and 2 deletions.
  1. +10 −2 src/app/qgisapp.cpp
  2. +2 −0 src/app/qgisapp.h
  3. +5 −0 src/app/qgsoptions.cpp
  4. +54 −0 src/ui/qgsoptionsbase.ui
@@ -3880,14 +3880,22 @@ 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 - timer will be started next time the mouse moves
mpMapTipsTimer->setInterval( 850 );
// 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/mapTipsDelay", 850 ).toInt();
mpMapTipsTimer->setInterval( timerInterval );
mpMapTipsTimer->setSingleShot( true );

// Create the maptips object
mpMaptip = new QgsMapTip();
}

void QgisApp::setMapTipsDelay( int timerInterval )
{
mpMapTipsTimer->setInterval( timerInterval );
}

void QgisApp::createDecorations()
{
QgsDecorationCopyright *mDecorationCopyright = new QgsDecorationCopyright( this );
@@ -966,6 +966,8 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
//! shows the snapping Options
void snappingOptions();

void setMapTipsDelay( int timerInterval );

protected:

//! Handle state changes (WindowTitleChange)
@@ -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
//
@@ -1311,7 +1314,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() );
mSettings->setValue( QStringLiteral( "/qgis/copyFeatureFormat" ), mComboCopyFeatureFormat->currentData().toInt() );
QgisApp::instance()->setMapTipsDelay( mMapTipsDelaySpinBox->value() );

mSettings->setValue( QStringLiteral( "/qgis/new_layers_visible" ), chkAddedVisibility->isChecked() );
mSettings->setValue( QStringLiteral( "/qgis/enable_anti_aliasing" ), chkAntiAliasing->isChecked() );
@@ -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">

0 comments on commit ccc1ac1

Please sign in to comment.
You can’t perform that action at this time.