Skip to content

Commit e4d2f34

Browse files
Gustry3nids
authored andcommitted
sipify QgsScaleCombobox
1 parent 80c8875 commit e4d2f34

File tree

3 files changed

+68
-23
lines changed

3 files changed

+68
-23
lines changed

python/auto_sip.blacklist

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -381,7 +381,6 @@ gui/qgsrasterlayersaveasdialog.sip
381381
gui/qgsrasterpyramidsoptionswidget.sip
382382
gui/qgsrelationeditorwidget.sip
383383
gui/qgsrubberband.sip
384-
gui/qgsscalecombobox.sip
385384
gui/qgsscalerangewidget.sip
386385
gui/qgsscalevisibilitydialog.sip
387386
gui/qgsscrollarea.sip

python/gui/qgsscalecombobox.sip

Lines changed: 66 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,45 +1,90 @@
1+
/************************************************************************
2+
* This file has been generated automatically from *
3+
* *
4+
* src/gui/qgsscalecombobox.h *
5+
* *
6+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
7+
************************************************************************/
8+
9+
10+
111

2-
/** A combobox which lets the user select map scale from predefined list
3-
* and highlights nearest to current scale value
4-
*/
512
class QgsScaleComboBox : QComboBox
613
{
7-
%TypeHeaderCode
8-
#include <qgsscalecombobox.h>
14+
%Docstring
15+
A combobox which lets the user select map scale from predefined list
16+
and highlights nearest to current scale value
17+
*
918
%End
1019

20+
%TypeHeaderCode
21+
#include "qgsscalecombobox.h"
22+
%End
1123
public:
12-
QgsScaleComboBox( QWidget* parent /TransferThis/ = 0 );
13-
~QgsScaleComboBox();
24+
QgsScaleComboBox( QWidget *parent /TransferThis/ = 0 );
1425

15-
//! Function to read the selected scale as text
1626
QString scaleString();
17-
//! Function to set the selected scale from text
18-
bool setScaleString( const QString& scaleTxt );
19-
//! Function to read the selected scale as double
27+
%Docstring
28+
Function to read the selected scale as text
29+
:rtype: str
30+
%End
31+
bool setScaleString( const QString &scaleTxt );
32+
%Docstring
33+
Function to set the selected scale from text
34+
:rtype: bool
35+
%End
2036
double scale() const;
21-
//! Function to set the selected scale from double
37+
%Docstring
38+
Function to read the selected scale as double
39+
:rtype: float
40+
%End
2241
void setScale( double scale );
23-
//! Function to read the min scale
42+
%Docstring
43+
Function to set the selected scale from double
44+
%End
2445
double minScale() const;
46+
%Docstring
47+
Function to read the min scale
48+
:rtype: float
49+
%End
2550

26-
//! Helper function to convert a double to scale string
27-
// Performs rounding, so an exact representation is not to
28-
// be expected.
2951
static QString toString( double scale );
30-
//! Helper function to convert a scale string to double
31-
static double toDouble( const QString& scaleString, bool *ok = 0 );
52+
%Docstring
53+
:rtype: str
54+
%End
55+
static double toDouble( const QString &scaleString, bool *ok = 0 );
56+
%Docstring
57+
Helper function to convert a scale string to double
58+
:rtype: float
59+
%End
3260

3361
signals:
34-
//! Signal is emitted when *user* has finished editing/selecting a new scale.
3562
void scaleChanged( double scale );
63+
%Docstring
64+
Signal is emitted when *user* has finished editing/selecting a new scale.
65+
%End
3666

3767
public slots:
3868
void updateScales( const QStringList &scales = QStringList() );
39-
//! Function to set the min scale
69+
4070
void setMinScale( double scale );
71+
%Docstring
72+
Set the minimum allowed scale.
73+
Anything scale lower than the minimum scale will automatically
74+
be converted to the minimum scale.
75+
Except for 0 which is always allowed.
76+
%End
4177

4278
protected:
43-
void showPopup();
79+
virtual void showPopup();
80+
81+
4482
};
4583

84+
/************************************************************************
85+
* This file has been generated automatically from *
86+
* *
87+
* src/gui/qgsscalecombobox.h *
88+
* *
89+
* Do not edit manually ! Edit header and run scripts/sipify.pl again *
90+
************************************************************************/

src/gui/qgsscalecombobox.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#define QGSSCALECOMBOBOX_H
2020

2121
#include <QComboBox>
22+
#include "qgis.h";
2223
#include "qgis_gui.h"
2324

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

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

0 commit comments

Comments
 (0)