Inviwo 0.9.12-pre
Inviwo documentation
Loading...
Searching...
No Matches
inviwo::NumberLineEdit Class Reference

widget for entering numbers with spinbox functionality. It uses less horizontal space than a QSpinBox and allows entering numbers in scientific notation. More...

#include <modules/qtwidgets/numberlineedit.h>

Inheritance diagram for inviwo::NumberLineEdit:

Public Member Functions

bool isValid () const
virtual QSize minimumSizeHint () const override
 NumberLineEdit (bool intMode, QWidget *parent=nullptr)
 NumberLineEdit (QWidget *parent=nullptr)
void setDecimals (int decimals)
void setIncrement (double inc)
void setInvalid (bool invalid=true)
void setMaximum (double max)
void setMinimum (double min)
void setRange (double min, double max)
virtual QSize sizeHint () const override
virtual QString textFromValue (double value) const override
virtual void timerEvent (QTimerEvent *event) override
 Overrides the timerEvent to prevent spinbox to be updated twice in case of calculations being slow.
virtual double valueFromText (const QString &str) const override

Protected Member Functions

virtual void changeEvent (QEvent *e) override
virtual void focusInEvent (QFocusEvent *e) override
virtual void focusOutEvent (QFocusEvent *e) override
virtual void resizeEvent (QResizeEvent *e) override
virtual void stepBy (int steps) override
virtual QValidator::State validate (QString &text, int &pos) const override
virtual void wheelEvent (QWheelEvent *e) override

Detailed Description

widget for entering numbers with spinbox functionality. It uses less horizontal space than a QSpinBox and allows entering numbers in scientific notation.

The widget supports the functionality of a regular QSpinBox, i.e. the value can also be adjusted using arrow keys and mouse wheel. If the widget cannot accommodate the current number representation of the value, the representation will be changed to scientific notation once the widget looses focus. While the widget is in focus the number is shown in regular notation, except for values less than 1e-6 which are depicted in scientific representation.

Member Function Documentation

◆ setIncrement()

void inviwo::NumberLineEdit::setIncrement ( double inc)

Sets the increment of a single step to inc. If inc is zero, the spinbox buttons will be hidden.

See also
QDoubleSpinBox::setSingleStep

The documentation for this class was generated from the following file:
  • modules/qtwidgets/include/modules/qtwidgets/numberlineedit.h