mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-16 00:03:12 -04:00
sipify QgsScaleWidget
This commit is contained in:
parent
dd6c7fdbc8
commit
36604196d7
@ -434,7 +434,6 @@ gui/qgsrubberband.sip
|
|||||||
gui/qgsscalecombobox.sip
|
gui/qgsscalecombobox.sip
|
||||||
gui/qgsscalerangewidget.sip
|
gui/qgsscalerangewidget.sip
|
||||||
gui/qgsscalevisibilitydialog.sip
|
gui/qgsscalevisibilitydialog.sip
|
||||||
gui/qgsscalewidget.sip
|
|
||||||
gui/qgsscrollarea.sip
|
gui/qgsscrollarea.sip
|
||||||
gui/qgssearchquerybuilder.sip
|
gui/qgssearchquerybuilder.sip
|
||||||
gui/qgsshortcutsmanager.sip
|
gui/qgsshortcutsmanager.sip
|
||||||
|
@ -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
|
class QgsScaleWidget : QWidget
|
||||||
{
|
{
|
||||||
%TypeHeaderCode
|
%Docstring
|
||||||
#include <qgsscalewidget.h>
|
A combobox which lets the user select map scale from predefined list
|
||||||
|
and highlights nearest to current scale value
|
||||||
|
*
|
||||||
%End
|
%End
|
||||||
|
|
||||||
|
%TypeHeaderCode
|
||||||
|
#include "qgsscalewidget.h"
|
||||||
|
%End
|
||||||
public:
|
public:
|
||||||
QgsScaleWidget( QWidget* parent /TransferThis/ = 0 );
|
explicit QgsScaleWidget( QWidget *parent /TransferThis/ = 0 );
|
||||||
~QgsScaleWidget();
|
|
||||||
|
|
||||||
//! 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 );
|
void setShowCurrentScaleButton( bool showCurrentScaleButton );
|
||||||
|
%Docstring
|
||||||
|
.. note::
|
||||||
|
|
||||||
|
the map canvas must be defined to show the button
|
||||||
|
|
||||||
|
%End
|
||||||
bool showCurrentScaleButton();
|
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();
|
QString scaleString();
|
||||||
//! Function to set the selected scale from text
|
%Docstring
|
||||||
bool setScaleString( const QString& scaleTxt );
|
Function to read the selected scale as text
|
||||||
//! Function to read the selected scale as double
|
:rtype: str
|
||||||
|
%End
|
||||||
|
bool setScaleString( const QString &scaleTxt );
|
||||||
|
%Docstring
|
||||||
|
Function to set the selected scale from text
|
||||||
|
:rtype: bool
|
||||||
|
%End
|
||||||
double scale() const;
|
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 );
|
void setScale( double scale );
|
||||||
//! Function to read the min scale
|
%Docstring
|
||||||
|
Function to set the selected scale from double
|
||||||
|
%End
|
||||||
double minScale() const;
|
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 );
|
static QString toString( double scale );
|
||||||
//! Helper function to convert a scale string to double
|
%Docstring
|
||||||
static double toDouble( const QString& scaleString, bool *ok = 0 );
|
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:
|
public slots:
|
||||||
void updateScales( const QStringList &scales = QStringList() );
|
void updateScales( const QStringList &scales = QStringList() );
|
||||||
|
|
||||||
//! assign the current scale from the map canvas
|
|
||||||
void setScaleFromCanvas();
|
void setScaleFromCanvas();
|
||||||
|
%Docstring
|
||||||
|
assign the current scale from the map canvas
|
||||||
|
%End
|
||||||
|
|
||||||
//! Function to set the min scale
|
|
||||||
void setMinScale( double scale );
|
void setMinScale( double scale );
|
||||||
|
%Docstring
|
||||||
|
Function to set the min scale
|
||||||
|
%End
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
//! Signal is emitted when *user* has finished editing/selecting a new scale.
|
|
||||||
void scaleChanged( double 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 *
|
||||||
|
************************************************************************/
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
|
|
||||||
#include "qgsscalecombobox.h"
|
#include "qgsscalecombobox.h"
|
||||||
#include "qgis_gui.h"
|
#include "qgis_gui.h"
|
||||||
|
#include "qgis.h"
|
||||||
|
|
||||||
class QgsMapCanvas;
|
class QgsMapCanvas;
|
||||||
|
|
||||||
@ -37,7 +38,7 @@ class GUI_EXPORT QgsScaleWidget : public QWidget
|
|||||||
Q_PROPERTY( bool minScale READ minScale WRITE setMinScale )
|
Q_PROPERTY( bool minScale READ minScale WRITE setMinScale )
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit QgsScaleWidget( QWidget *parent = nullptr );
|
explicit QgsScaleWidget( QWidget *parent SIP_TRANSFERTHIS = nullptr );
|
||||||
|
|
||||||
//! shows a button to set the scale to the current scale of the map canvas next to the combobox
|
//! 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
|
//! \note the map canvas must be defined to show the button
|
||||||
|
Loading…
x
Reference in New Issue
Block a user