QGIS API Documentation  2.0.1-Dufour
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Slots | Signals | Public Member Functions | Static Public Member Functions | Protected Member Functions | Private Slots | Private Attributes | 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>

Public Slots

void updateScales (const QStringList &scales=QStringList())

Signals

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

Public Member Functions

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

Static Public Member Functions

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

Protected Member Functions

void showPopup ()

Private Slots

void fixupScale ()
 Slot called when QComboBox has changed.

Private Attributes

double mScale

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 ( QWidget *  parent = 0)

Definition at line 27 of file qgsscalecombobox.cpp.

References fixupScale(), and updateScales().

QgsScaleComboBox::~QgsScaleComboBox ( )
virtual

Definition at line 39 of file qgsscalecombobox.cpp.

Member Function Documentation

void QgsScaleComboBox::fixupScale ( )
privateslot

Slot called when QComboBox has changed.

Definition at line 145 of file qgsscalecombobox.cpp.

References mScale, scaleChanged(), setScale(), and toDouble().

Referenced by QgsScaleComboBox().

double QgsScaleComboBox::scale ( )

Function to read the selected scale as double.

Definition at line 132 of file qgsscalecombobox.cpp.

References mScale.

Referenced by toDouble().

void QgsScaleComboBox::scaleChanged ( )
signal

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

Referenced by fixupScale().

QString QgsScaleComboBox::scaleString ( )

Function to read the selected scale as text.

Definition at line 106 of file qgsscalecombobox.cpp.

References mScale, and toString().

void QgsScaleComboBox::setScale ( double  scale)

Function to set the selected scale from double.

Definition at line 139 of file qgsscalecombobox.cpp.

References setScaleString(), and toString().

Referenced by fixupScale().

bool QgsScaleComboBox::setScaleString ( QString  scaleTxt)

Function to set the selected scale from text.

Definition at line 113 of file qgsscalecombobox.cpp.

References mScale, toDouble(), and toString().

Referenced by setScale(), and updateScales().

void QgsScaleComboBox::showPopup ( )
protected

Definition at line 73 of file qgsscalecombobox.cpp.

References MathUtils::min().

double QgsScaleComboBox::toDouble ( QString  scaleString,
bool *  ok = NULL 
)
static

Helper function to convert a scale string to double.

Definition at line 191 of file qgsscalecombobox.cpp.

References scale(), and toString().

Referenced by fixupScale(), and setScaleString().

QString QgsScaleComboBox::toString ( double  scale)
static

Helper function to convert a double to scale string.

Definition at line 179 of file qgsscalecombobox.cpp.

Referenced by scaleString(), setScale(), setScaleString(), and toDouble().

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

Definition at line 43 of file qgsscalecombobox.cpp.

References PROJECT_SCALES, and setScaleString().

Referenced by QgsScaleComboBox().

Member Data Documentation

double QgsScaleComboBox::mScale
private

Definition at line 71 of file qgsscalecombobox.h.

Referenced by fixupScale(), scale(), scaleString(), and setScaleString().


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