QGIS API Documentation  2.99.0-Master (e077efd)
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
QgsScaleComboBox Class Reference

A combobox which lets the user select map scale from predefined list and highlights nearest to current scale value. More...

#include <qgsscalecombobox.h>

Inheritance diagram for QgsScaleComboBox:
Inheritance graph
[legend]

Public Slots

void setMinScale (double scale)
 Set the minimum allowed scale. More...
 
void updateScales (const QStringList &scales=QStringList())
 

Signals

void scaleChanged (double scale)
 Signal is emitted when user has finished editing/selecting a new scale. More...
 

Public Member Functions

 QgsScaleComboBox (QWidget *parent=nullptr)
 
virtual ~QgsScaleComboBox ()
 
double minScale () const
 Function to read the min scale. More...
 
double scale () const
 Function to read the selected scale as double. More...
 
QString scaleString ()
 Function to read the selected scale as text. More...
 
void setScale (double scale)
 Function to set the selected scale from double. More...
 
bool setScaleString (const QString &scaleTxt)
 Function to set the selected scale from text. More...
 

Static Public Member Functions

static double toDouble (const QString &scaleString, bool *ok=nullptr)
 Helper function to convert a scale string to double. More...
 
static QString toString (double scale)
 Helper function to convert a double to scale string. More...
 

Protected Member Functions

void showPopup () override
 

Detailed Description

A combobox which lets the user select map scale from predefined list and highlights nearest to current scale value.

Definition at line 27 of file qgsscalecombobox.h.

Constructor & Destructor Documentation

§ QgsScaleComboBox()

QgsScaleComboBox::QgsScaleComboBox ( QWidget *  parent = nullptr)

Definition at line 27 of file qgsscalecombobox.cpp.

§ ~QgsScaleComboBox()

QgsScaleComboBox::~QgsScaleComboBox ( )
virtual

Definition at line 42 of file qgsscalecombobox.cpp.

Member Function Documentation

§ minScale()

double QgsScaleComboBox::minScale ( ) const
inline

Function to read the min scale.

Definition at line 43 of file qgsscalecombobox.h.

§ scale()

double QgsScaleComboBox::scale ( ) const

Function to read the selected scale as double.

Definition at line 155 of file qgsscalecombobox.cpp.

§ scaleChanged

void QgsScaleComboBox::scaleChanged ( double  scale)
signal

Signal is emitted when user has finished editing/selecting a new scale.

§ scaleString()

QString QgsScaleComboBox::scaleString ( )

Function to read the selected scale as text.

Definition at line 122 of file qgsscalecombobox.cpp.

§ setMinScale

void QgsScaleComboBox::setMinScale ( double  scale)
slot

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.

Definition at line 246 of file qgsscalecombobox.cpp.

§ setScale()

void QgsScaleComboBox::setScale ( double  scale)

Function to set the selected scale from double.

Definition at line 161 of file qgsscalecombobox.cpp.

§ setScaleString()

bool QgsScaleComboBox::setScaleString ( const QString &  scaleTxt)

Function to set the selected scale from text.

Definition at line 128 of file qgsscalecombobox.cpp.

§ showPopup()

void QgsScaleComboBox::showPopup ( )
overrideprotected

Definition at line 89 of file qgsscalecombobox.cpp.

§ toDouble()

double QgsScaleComboBox::toDouble ( const QString &  scaleString,
bool *  ok = nullptr 
)
static

Helper function to convert a scale string to double.

Definition at line 207 of file qgsscalecombobox.cpp.

§ toString()

QString QgsScaleComboBox::toString ( double  scale)
static

Helper function to convert a double to scale string.

Definition at line 191 of file qgsscalecombobox.cpp.

§ updateScales

void QgsScaleComboBox::updateScales ( const QStringList &  scales = QStringList())
slot

Definition at line 46 of file qgsscalecombobox.cpp.


The documentation for this class was generated from the following files: