Skip to content
Permalink
Browse files
sipify QgsScaleCombobox
  • Loading branch information
Gustry authored and 3nids committed Apr 30, 2017
1 parent 80c8875 commit e4d2f34f3fdef6c2e9a06d3f1364935a128dd280
Showing with 68 additions and 23 deletions.
  1. +0 −1 python/auto_sip.blacklist
  2. +66 −21 python/gui/qgsscalecombobox.sip
  3. +2 −1 src/gui/qgsscalecombobox.h
@@ -381,7 +381,6 @@ gui/qgsrasterlayersaveasdialog.sip
gui/qgsrasterpyramidsoptionswidget.sip
gui/qgsrelationeditorwidget.sip
gui/qgsrubberband.sip
gui/qgsscalecombobox.sip
gui/qgsscalerangewidget.sip
gui/qgsscalevisibilitydialog.sip
gui/qgsscrollarea.sip
@@ -1,45 +1,90 @@
/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsscalecombobox.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/




/** A combobox which lets the user select map scale from predefined list
* and highlights nearest to current scale value
*/
class QgsScaleComboBox : QComboBox
{
%TypeHeaderCode
#include <qgsscalecombobox.h>
%Docstring
A combobox which lets the user select map scale from predefined list
and highlights nearest to current scale value
*
%End

%TypeHeaderCode
#include "qgsscalecombobox.h"
%End
public:
QgsScaleComboBox( QWidget* parent /TransferThis/ = 0 );
~QgsScaleComboBox();
QgsScaleComboBox( QWidget *parent /TransferThis/ = 0 );

//! 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
: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

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

public slots:
void updateScales( const QStringList &scales = QStringList() );
//! Function to set the min scale

void setMinScale( double scale );
%Docstring
Set the minimum allowed scale.
Anything scale lower than the minimum scale will automatically
be converted to the minimum scale.
Except for 0 which is always allowed.
%End

protected:
void showPopup();
virtual void showPopup();


};

/************************************************************************
* This file has been generated automatically from *
* *
* src/gui/qgsscalecombobox.h *
* *
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
************************************************************************/
@@ -19,6 +19,7 @@
#define QGSSCALECOMBOBOX_H

#include <QComboBox>
#include "qgis.h";
#include "qgis_gui.h"

/** \ingroup gui
@@ -29,7 +30,7 @@ class GUI_EXPORT QgsScaleComboBox : public QComboBox
{
Q_OBJECT
public:
QgsScaleComboBox( QWidget *parent = nullptr );
QgsScaleComboBox( QWidget *parent SIP_TRANSFERTHIS = nullptr );

//! Function to read the selected scale as text
QString scaleString();

0 comments on commit e4d2f34

Please sign in to comment.