2012-01-10 15:50:48 +02:00
|
|
|
|
|
|
|
/** A combobox which lets the user select map scale from predefined list
|
2012-01-10 15:53:02 +02:00
|
|
|
* and highlights nearest to current scale value
|
2012-01-10 15:50:48 +02:00
|
|
|
*/
|
|
|
|
class QgsScaleComboBox : QComboBox
|
|
|
|
{
|
|
|
|
%TypeHeaderCode
|
|
|
|
#include <qgsscalecombobox.h>
|
|
|
|
%End
|
|
|
|
|
2012-07-05 17:06:04 +03:00
|
|
|
public:
|
2012-01-10 15:50:48 +02:00
|
|
|
QgsScaleComboBox(QWidget * parent = 0);
|
|
|
|
~QgsScaleComboBox();
|
2012-07-05 17:06:04 +03:00
|
|
|
|
2012-09-21 19:09:57 +02:00
|
|
|
//! Function to read the selected scale as text
|
|
|
|
// @note added in 2.0
|
|
|
|
QString scaleString();
|
|
|
|
//! Function to set the selected scale from text
|
|
|
|
// @note added in 2.0
|
|
|
|
bool setScaleString( QString scaleTxt );
|
|
|
|
//! Function to read the selected scale as double
|
|
|
|
// @note added in 2.0
|
|
|
|
double scale();
|
|
|
|
//! Function to set the selected scale from double
|
|
|
|
// @note added in 2.0
|
|
|
|
void setScale( double scale );
|
|
|
|
|
|
|
|
//! Helper function to convert a double to scale string
|
|
|
|
// Performs rounding, so an exact representation is not to
|
|
|
|
// be expected.
|
|
|
|
// @note added in 2.0
|
|
|
|
static QString toString( double scale );
|
|
|
|
//! Helper function to convert a scale string to double
|
|
|
|
// @note added in 2.0
|
|
|
|
static double toDouble( QString scaleString, bool *ok = NULL );
|
|
|
|
|
2012-07-05 17:06:04 +03:00
|
|
|
public slots:
|
|
|
|
void updateScales( const QStringList &scales = QStringList() );
|
2012-01-10 15:50:48 +02:00
|
|
|
};
|
|
|
|
|