[Marble-commits] KDE/kdeedu/marble/src/lib
Jens-Michael Hoffmann
jensmh at gmx.de
Mon Apr 26 12:28:41 CEST 2010
SVN commit 1118970 by jmhoffmann:
LatLonBoxWidget: instead of using 1.0 as single step value, use 10% of angle.
M +22 -0 LatLonBoxWidget.cpp
M +4 -0 LatLonBoxWidget.h
--- trunk/KDE/kdeedu/marble/src/lib/LatLonBoxWidget.cpp #1118969:1118970
@@ -36,10 +36,16 @@
: QWidget( parent, f ),
d( new Private( this ))
{
+ // used for updating tiles count in DownloadRegionDialog
connect( d->m_ui.northSpinBox, SIGNAL( valueChanged( double )), SIGNAL( valueChanged() ));
connect( d->m_ui.southSpinBox, SIGNAL( valueChanged( double )), SIGNAL( valueChanged() ));
connect( d->m_ui.eastSpinBox, SIGNAL( valueChanged( double )), SIGNAL( valueChanged() ));
connect( d->m_ui.westSpinBox, SIGNAL( valueChanged( double )), SIGNAL( valueChanged() ));
+ // used for adjusting single step values
+ connect( d->m_ui.northSpinBox, SIGNAL( valueChanged( double )), SLOT( updateLatSingleStep() ));
+ connect( d->m_ui.southSpinBox, SIGNAL( valueChanged( double )), SLOT( updateLatSingleStep() ));
+ connect( d->m_ui.eastSpinBox, SIGNAL( valueChanged( double )), SLOT( updateLonSingleStep() ));
+ connect( d->m_ui.westSpinBox, SIGNAL( valueChanged( double )), SLOT( updateLonSingleStep() ));
}
GeoDataLatLonBox LatLonBoxWidget::latLonBox() const
@@ -57,6 +63,22 @@
d->m_ui.westSpinBox->setValue( latLonBox.west( GeoDataCoordinates::Degree ));
}
+void LatLonBoxWidget::updateLatSingleStep()
+{
+ double const singleStep =
+ qAbs( d->m_ui.northSpinBox->value() - d->m_ui.southSpinBox->value() ) / 10.0;
+ d->m_ui.northSpinBox->setSingleStep( singleStep );
+ d->m_ui.southSpinBox->setSingleStep( singleStep );
}
+void LatLonBoxWidget::updateLonSingleStep()
+{
+ double const singleStep =
+ qAbs( d->m_ui.eastSpinBox->value() - d->m_ui.westSpinBox->value() ) / 10.0;
+ d->m_ui.eastSpinBox->setSingleStep( singleStep );
+ d->m_ui.westSpinBox->setSingleStep( singleStep );
+}
+
+}
+
#include "LatLonBoxWidget.moc"
--- trunk/KDE/kdeedu/marble/src/lib/LatLonBoxWidget.h #1118969:1118970
@@ -32,6 +32,10 @@
GeoDataLatLonBox latLonBox() const;
void setLatLonBox( GeoDataLatLonBox const & );
+ public Q_SLOTS:
+ void updateLatSingleStep();
+ void updateLonSingleStep();
+
Q_SIGNALS:
void valueChanged();
More information about the Marble-commits
mailing list