QGIS API Documentation  2.8.2-Wien
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Public Member Functions | Protected Member Functions | Properties | List of all members
QgsDoubleSpinBox Class Reference

The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value. More...

#include <qgsdoublespinbox.h>

Public Types

enum  ClearValueMode { MinimumValue, MaximumValue, CustomValue }

Public Member Functions

 QgsDoubleSpinBox (QWidget *parent=0)
virtual void clear () override
 Set the current value to the value defined by the clear value.
double clearValue () const
 returns the value used when clear() is called.
bool expressionsEnabled () const
 Returns whether the widget will allow entry of simple expressions, which are evaluated and then discarded.
void setClearValue (double customValue, QString clearValueText=QString())
 setClearValue defines the clear value as a custom value and will automatically set the clear value mode to CustomValue
void setClearValueMode (ClearValueMode mode, QString clearValueText=QString())
 setClearValueMode defines if the clear value should be the minimum or maximum values of the widget or a custom value
void setExpressionsEnabled (const bool enabled)
 Sets if the widget will allow entry of simple expressions, which are evaluated and then discarded.
void setShowClearButton (const bool showClearButton)
 determines if the widget will show a clear button
bool showClearButton () const
virtual QValidator::State validate (QString &input, int &pos) const override
virtual double valueFromText (const QString &text) const override

Protected Member Functions

virtual void changeEvent (QEvent *event) override
virtual void paintEvent (QPaintEvent *event) override
virtual void resizeEvent (QResizeEvent *event) override

Properties

bool expressionsEnabled
bool showClearButton

Detailed Description

The QgsSpinBox is a spin box with a clear button that will set the value to the defined clear value.

The clear value can be either the minimum or the maiximum value of the spin box or a custom value. This value can then be handled by a special value text.

Definition at line 27 of file qgsdoublespinbox.h.

Member Enumeration Documentation

Enumerator:
MinimumValue 
MaximumValue 
CustomValue 

Definition at line 34 of file qgsdoublespinbox.h.

Constructor & Destructor Documentation

QgsDoubleSpinBox::QgsDoubleSpinBox ( QWidget *  parent = 0)
explicit

Definition at line 27 of file qgsdoublespinbox.cpp.

Member Function Documentation

void QgsDoubleSpinBox::changeEvent ( QEvent *  event)
overrideprotectedvirtual

Definition at line 60 of file qgsdoublespinbox.cpp.

void QgsDoubleSpinBox::clear ( )
overridevirtual

Set the current value to the value defined by the clear value.

Definition at line 77 of file qgsdoublespinbox.cpp.

double QgsDoubleSpinBox::clearValue ( ) const

returns the value used when clear() is called.

Definition at line 110 of file qgsdoublespinbox.cpp.

bool QgsDoubleSpinBox::expressionsEnabled ( ) const
inline

Returns whether the widget will allow entry of simple expressions, which are evaluated and then discarded.

Returns
true if spin box allows expression entry
Note
added in QGIS 2.7

Definition at line 59 of file qgsdoublespinbox.h.

void QgsDoubleSpinBox::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Definition at line 66 of file qgsdoublespinbox.cpp.

void QgsDoubleSpinBox::resizeEvent ( QResizeEvent *  event)
overrideprotectedvirtual

Definition at line 191 of file qgsdoublespinbox.cpp.

void QgsDoubleSpinBox::setClearValue ( double  customValue,
QString  clearValueText = QString() 
)

setClearValue defines the clear value as a custom value and will automatically set the clear value mode to CustomValue

Parameters
customValuedefines the numerical value used as the clear value
clearValueTextis the text displayed when the spin box is at the clear value. If not specified, no special value text is used.

Definition at line 82 of file qgsdoublespinbox.cpp.

void QgsDoubleSpinBox::setClearValueMode ( QgsDoubleSpinBox::ClearValueMode  mode,
QString  clearValueText = QString() 
)

setClearValueMode defines if the clear value should be the minimum or maximum values of the widget or a custom value

Parameters
modemode to user for clear value
clearValueTextis the text displayed when the spin box is at the clear value. If not specified, no special value text is used.

Definition at line 96 of file qgsdoublespinbox.cpp.

void QgsDoubleSpinBox::setExpressionsEnabled ( const bool  enabled)

Sets if the widget will allow entry of simple expressions, which are evaluated and then discarded.

Parameters
enabledset to true to allow expression entry
Note
added in QGIS 2.7

Definition at line 55 of file qgsdoublespinbox.cpp.

void QgsDoubleSpinBox::setShowClearButton ( const bool  showClearButton)

determines if the widget will show a clear button

Note
the clear button will set the widget to its minimum value

Definition at line 49 of file qgsdoublespinbox.cpp.

bool QgsDoubleSpinBox::showClearButton ( ) const
inline

Definition at line 46 of file qgsdoublespinbox.h.

QValidator::State QgsDoubleSpinBox::validate ( QString &  input,
int &  pos 
) const
overridevirtual

Definition at line 166 of file qgsdoublespinbox.cpp.

double QgsDoubleSpinBox::valueFromText ( const QString &  text) const
overridevirtual

Definition at line 150 of file qgsdoublespinbox.cpp.

Property Documentation

bool QgsDoubleSpinBox::expressionsEnabled
readwrite

Definition at line 31 of file qgsdoublespinbox.h.

bool QgsDoubleSpinBox::showClearButton
readwrite

Definition at line 30 of file qgsdoublespinbox.h.


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