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
QgsSpinBox Class Reference

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

#include <qgsspinbox.h>

Public Types

enum  ClearValueMode { MinimumValue, MaximumValue, CustomValue }

Public Member Functions

 QgsSpinBox (QWidget *parent=0)
virtual void clear () override
 Set the current value to the value defined by the clear value.
int 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 (int customValue, QString clearValueText=QString())
 setClearValue defines the clear value for the widget 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 int 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 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 qgsspinbox.h.

Member Enumeration Documentation

Enumerator:
MinimumValue 
MaximumValue 
CustomValue 

Definition at line 33 of file qgsspinbox.h.

Constructor & Destructor Documentation

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

Definition at line 27 of file qgsspinbox.cpp.

Member Function Documentation

void QgsSpinBox::changeEvent ( QEvent *  event)
overrideprotectedvirtual

Definition at line 60 of file qgsspinbox.cpp.

void QgsSpinBox::clear ( )
overridevirtual

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

Definition at line 77 of file qgsspinbox.cpp.

int QgsSpinBox::clearValue ( ) const

returns the value used when clear() is called.

Definition at line 110 of file qgsspinbox.cpp.

bool QgsSpinBox::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 58 of file qgsspinbox.h.

void QgsSpinBox::paintEvent ( QPaintEvent *  event)
overrideprotectedvirtual

Definition at line 66 of file qgsspinbox.cpp.

void QgsSpinBox::resizeEvent ( QResizeEvent *  event)
overrideprotectedvirtual

Definition at line 191 of file qgsspinbox.cpp.

void QgsSpinBox::setClearValue ( int  customValue,
QString  clearValueText = QString() 
)

setClearValue defines the clear value for the widget 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 qgsspinbox.cpp.

void QgsSpinBox::setClearValueMode ( QgsSpinBox::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 qgsspinbox.cpp.

void QgsSpinBox::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 qgsspinbox.cpp.

void QgsSpinBox::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 qgsspinbox.cpp.

bool QgsSpinBox::showClearButton ( ) const
inline

Definition at line 45 of file qgsspinbox.h.

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

Definition at line 136 of file qgsspinbox.cpp.

int QgsSpinBox::valueFromText ( const QString &  text) const
overridevirtual

Definition at line 120 of file qgsspinbox.cpp.

Property Documentation

bool QgsSpinBox::showClearButton
readwrite

Definition at line 30 of file qgsspinbox.h.


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