2017-04-30 16:22:23 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsscalecombobox.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
|
2012-01-10 15:50:48 +02:00
|
|
|
|
|
|
|
class QgsScaleComboBox : QComboBox
|
|
|
|
{
|
2017-04-30 16:22:23 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
A combobox which lets the user select map scale from predefined list
|
|
|
|
and highlights nearest to current scale value
|
2017-04-30 16:22:23 +02:00
|
|
|
*
|
2012-01-10 15:50:48 +02:00
|
|
|
%End
|
|
|
|
|
2017-04-30 16:22:23 +02:00
|
|
|
%TypeHeaderCode
|
|
|
|
#include "qgsscalecombobox.h"
|
|
|
|
%End
|
2012-07-05 17:06:04 +03:00
|
|
|
public:
|
2017-06-02 14:08:42 +10:00
|
|
|
|
2017-04-30 16:22:23 +02:00
|
|
|
QgsScaleComboBox( QWidget *parent /TransferThis/ = 0 );
|
2017-06-02 14:08:42 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Constructor for QgsScaleComboBox.
|
2017-06-02 14:08:42 +10:00
|
|
|
%End
|
2012-07-05 17:06:04 +03:00
|
|
|
|
2017-06-02 14:08:42 +10:00
|
|
|
QString scaleString() const;
|
2017-04-30 16:22:23 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the selected scale as a string, e.g. "1:150".
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setScaleString`
|
2017-04-30 16:22:23 +02:00
|
|
|
%End
|
2017-06-02 14:08:42 +10:00
|
|
|
|
|
|
|
bool setScaleString( const QString &string );
|
2017-04-30 16:22:23 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the selected scale from a ``string``, e.g. "1:150".
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`scaleString`
|
2017-04-30 16:22:23 +02:00
|
|
|
%End
|
2017-06-02 14:08:42 +10:00
|
|
|
|
2016-03-03 09:32:30 +01:00
|
|
|
double scale() const;
|
2017-04-30 16:22:23 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the selected scale as a double.
|
|
|
|
The scale value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`setScale`
|
2017-04-30 16:22:23 +02:00
|
|
|
%End
|
2017-06-02 14:08:42 +10:00
|
|
|
|
2016-03-03 09:32:30 +01:00
|
|
|
double minScale() const;
|
2017-04-30 16:22:23 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Returns the minimum scale, or 0 if no minimum scale set.
|
|
|
|
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
|
|
|
|
Any scale lower than the minimum scale will automatically be converted to the minimum scale.
|
|
|
|
Except for 0 which is always allowed.
|
2017-04-30 16:22:23 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2012-09-21 19:09:57 +02:00
|
|
|
static QString toString( double scale );
|
2017-04-30 16:22:23 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Helper function to convert a ``scale`` double to scale string.
|
|
|
|
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
|
|
|
|
|
|
|
|
The returned string will be rounded (e.g. 1:1000, not 1:1000.345).
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`toDouble`
|
2017-04-30 16:22:23 +02:00
|
|
|
%End
|
2017-06-02 14:08:42 +10:00
|
|
|
|
|
|
|
static double toDouble( const QString &string, bool *ok = 0 );
|
2017-04-30 16:22:23 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Helper function to convert a scale ``string`` to double.
|
|
|
|
The returned value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
|
|
|
|
If specified, ``ok`` will be set to true if the string was successfully interpreted as a scale.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`toString`
|
2017-04-30 16:22:23 +02:00
|
|
|
%End
|
2012-09-21 19:09:57 +02:00
|
|
|
|
2012-09-24 02:28:15 +02:00
|
|
|
signals:
|
2017-06-02 14:08:42 +10:00
|
|
|
|
2016-03-03 09:32:30 +01:00
|
|
|
void scaleChanged( double scale );
|
2017-04-30 16:22:23 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Emitted when *user* has finished editing/selecting a new scale.
|
|
|
|
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
|
2017-04-30 16:22:23 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
2012-07-05 17:06:04 +03:00
|
|
|
public slots:
|
2017-06-02 14:08:42 +10:00
|
|
|
|
2012-07-05 17:06:04 +03:00
|
|
|
void updateScales( const QStringList &scales = QStringList() );
|
2017-06-02 14:08:42 +10:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Sets the list of predefined ``scales`` to show in the combobox. List elements
|
|
|
|
are expected to be valid scale strings, such as "1:1000000".
|
2017-06-02 14:08:42 +10:00
|
|
|
%End
|
|
|
|
|
|
|
|
void setScale( double scale );
|
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the selected scale from a double.
|
|
|
|
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
|
|
|
|
|
2018-01-09 17:26:37 -04:00
|
|
|
.. seealso:: :py:func:`scale`
|
2017-06-02 14:08:42 +10:00
|
|
|
%End
|
2017-04-30 16:22:23 +02:00
|
|
|
|
2016-03-03 09:32:30 +01:00
|
|
|
void setMinScale( double scale );
|
2017-04-30 16:22:23 +02:00
|
|
|
%Docstring
|
2017-12-15 10:36:55 -04:00
|
|
|
Set the minimum allowed ``scale``. Set to 0 to disable the minimum scale.
|
|
|
|
The ``scale`` value indicates the scale denominator, e.g. 1000.0 for a 1:1000 map.
|
|
|
|
Any scale lower than the minimum scale will automatically be converted to the minimum scale.
|
|
|
|
Except for 0 which is always allowed.
|
2017-04-30 16:22:23 +02:00
|
|
|
%End
|
2012-09-24 02:28:15 +02:00
|
|
|
|
|
|
|
protected:
|
2017-04-30 16:22:23 +02:00
|
|
|
virtual void showPopup();
|
|
|
|
|
|
|
|
|
2012-01-10 15:50:48 +02:00
|
|
|
};
|
|
|
|
|
2017-04-30 16:22:23 +02:00
|
|
|
/************************************************************************
|
|
|
|
* This file has been generated automatically from *
|
|
|
|
* *
|
|
|
|
* src/gui/qgsscalecombobox.h *
|
|
|
|
* *
|
|
|
|
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
|
|
|
|
************************************************************************/
|