QGIS API Documentation  2.9.0-Master
Signals | Public Member Functions | List of all members
QgsUnitSelectionWidget Class Reference

Widget displaying a combobox allowing the user to choose between millimeter and map units If the user chooses map units, a button appears allowing the specification of minimum and maximum scale. More...

#include <qgsunitselectionwidget.h>

Inheritance diagram for QgsUnitSelectionWidget:
Inheritance graph
[legend]

Signals

void changed ()
 

Public Member Functions

 QgsUnitSelectionWidget (QWidget *parent=0)
 
QgsMapUnitScale getMapUnitScale () const
 Returns the map unit scale. More...
 
int getUnit () const
 Get the selected unit index. More...
 
void setMapUnitScale (const QgsMapUnitScale &scale)
 Sets the map unit scale. More...
 
void setUnit (int unitIndex)
 Sets the selected unit index. More...
 
void setUnit (QgsSymbolV2::OutputUnit unit)
 Sets the selected unit. More...
 
void setUnits (const QStringList &units, int mapUnitIdx)
 Sets the units which the user can choose from in the combobox. More...
 
void setUnits (const QgsSymbolV2::OutputUnitList &units)
 Sets the units which the user can choose from in the combobox. More...
 
QgsSymbolV2::OutputUnit unit () const
 Returns the current predefined selected unit (if applicable). More...
 

Detailed Description

Widget displaying a combobox allowing the user to choose between millimeter and map units If the user chooses map units, a button appears allowing the specification of minimum and maximum scale.

Definition at line 46 of file qgsunitselectionwidget.h.

Constructor & Destructor Documentation

QgsUnitSelectionWidget::QgsUnitSelectionWidget ( QWidget *  parent = 0)

Definition at line 70 of file qgsunitselectionwidget.cpp.

Member Function Documentation

void QgsUnitSelectionWidget::changed ( )
signal
QgsMapUnitScale QgsUnitSelectionWidget::getMapUnitScale ( ) const
inline

Returns the map unit scale.

Definition at line 89 of file qgsunitselectionwidget.h.

int QgsUnitSelectionWidget::getUnit ( ) const
inline

Get the selected unit index.

Definition at line 70 of file qgsunitselectionwidget.h.

void QgsUnitSelectionWidget::setMapUnitScale ( const QgsMapUnitScale scale)
inline

Sets the map unit scale.

Definition at line 92 of file qgsunitselectionwidget.h.

void QgsUnitSelectionWidget::setUnit ( int  unitIndex)

Sets the selected unit index.

Parameters
unitIndexindex of unit to set as current

Definition at line 134 of file qgsunitselectionwidget.cpp.

void QgsUnitSelectionWidget::setUnit ( QgsSymbolV2::OutputUnit  unit)

Sets the selected unit.

Parameters
unitpredefined unit to set as current

Definition at line 141 of file qgsunitselectionwidget.cpp.

void QgsUnitSelectionWidget::setUnits ( const QStringList &  units,
int  mapUnitIdx 
)

Sets the units which the user can choose from in the combobox.

Parameters
unitslist of strings for custom units to display in the widget
mapUnitIdxspecifies which entry corresponds to the map units, or -1 if none

Definition at line 88 of file qgsunitselectionwidget.cpp.

void QgsUnitSelectionWidget::setUnits ( const QgsSymbolV2::OutputUnitList units)

Sets the units which the user can choose from in the combobox.

Clears any existing units.

Parameters
unitslist of valid units
Note
added in QGIS 2.9

Definition at line 96 of file qgsunitselectionwidget.cpp.

QgsSymbolV2::OutputUnit QgsUnitSelectionWidget::unit ( ) const

Returns the current predefined selected unit (if applicable).

Returns
selected output unit, or QgsSymbolV2::Mixed if the widget was populated with custom unit types
Note
added in QGIS 2.9

Definition at line 120 of file qgsunitselectionwidget.cpp.


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