Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
80 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,57 +1,108 @@ | ||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsscalewidget.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ | ||
|
||
|
||
|
||
|
||
|
||
|
||
/** \ingroup gui | ||
* A combobox which lets the user select map scale from predefined list | ||
* and highlights nearest to current scale value | ||
**/ | ||
class QgsScaleWidget : QWidget | ||
{ | ||
%TypeHeaderCode | ||
#include <qgsscalewidget.h> | ||
%Docstring | ||
A combobox which lets the user select map scale from predefined list | ||
and highlights nearest to current scale value | ||
* | ||
%End | ||
|
||
%TypeHeaderCode | ||
#include "qgsscalewidget.h" | ||
%End | ||
public: | ||
QgsScaleWidget( QWidget* parent /TransferThis/ = 0 ); | ||
~QgsScaleWidget(); | ||
explicit QgsScaleWidget( QWidget *parent /TransferThis/ = 0 ); | ||
|
||
//! shows a button to set the scale to the current scale of the map canvas next to the combobox | ||
//! @note the map canvas must be defined to show the button | ||
void setShowCurrentScaleButton( bool showCurrentScaleButton ); | ||
%Docstring | ||
.. note:: | ||
|
||
the map canvas must be defined to show the button | ||
|
||
%End | ||
bool showCurrentScaleButton(); | ||
%Docstring | ||
:rtype: bool | ||
%End | ||
|
||
//! set the map canvas associated to the current button | ||
void setMapCanvas( QgsMapCanvas* canvas ); | ||
void setMapCanvas( QgsMapCanvas *canvas ); | ||
%Docstring | ||
set the map canvas associated to the current button | ||
%End | ||
|
||
//! Function to read the selected scale as text | ||
QString scaleString(); | ||
//! Function to set the selected scale from text | ||
bool setScaleString( const QString& scaleTxt ); | ||
//! Function to read the selected scale as double | ||
%Docstring | ||
Function to read the selected scale as text | ||
:rtype: str | ||
%End | ||
bool setScaleString( const QString &scaleTxt ); | ||
%Docstring | ||
Function to set the selected scale from text | ||
:rtype: bool | ||
%End | ||
double scale() const; | ||
//! Function to set the selected scale from double | ||
%Docstring | ||
Function to read the selected scale as double | ||
:rtype: float | ||
%End | ||
void setScale( double scale ); | ||
//! Function to read the min scale | ||
%Docstring | ||
Function to set the selected scale from double | ||
%End | ||
double minScale() const; | ||
%Docstring | ||
Function to read the min scale | ||
:rtype: float | ||
%End | ||
|
||
//! Helper function to convert a double to scale string | ||
// Performs rounding, so an exact representation is not to | ||
// be expected. | ||
static QString toString( double scale ); | ||
//! Helper function to convert a scale string to double | ||
static double toDouble( const QString& scaleString, bool *ok = 0 ); | ||
%Docstring | ||
be expected. | ||
:rtype: str | ||
%End | ||
static double toDouble( const QString &scaleString, bool *ok = 0 ); | ||
%Docstring | ||
Helper function to convert a scale string to double | ||
:rtype: float | ||
%End | ||
|
||
public slots: | ||
void updateScales( const QStringList &scales = QStringList() ); | ||
|
||
//! assign the current scale from the map canvas | ||
void setScaleFromCanvas(); | ||
%Docstring | ||
assign the current scale from the map canvas | ||
%End | ||
|
||
//! Function to set the min scale | ||
void setMinScale( double scale ); | ||
%Docstring | ||
Function to set the min scale | ||
%End | ||
|
||
signals: | ||
//! Signal is emitted when *user* has finished editing/selecting a new scale. | ||
void scaleChanged( double scale ); | ||
|
||
%Docstring | ||
Signal is emitted when *user* has finished editing/selecting a new scale. | ||
%End | ||
|
||
}; | ||
|
||
/************************************************************************ | ||
* This file has been generated automatically from * | ||
* * | ||
* src/gui/qgsscalewidget.h * | ||
* * | ||
* Do not edit manually ! Edit header and run scripts/sipify.pl again * | ||
************************************************************************/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters