trikRuntime
trikGui::NumberSelectionWidget Class Reference

Widget that allows to input integer numbers using robot keys. More...

#include <numberSelectionWidget.h>

Inheritance diagram for trikGui::NumberSelectionWidget:
Collaboration diagram for trikGui::NumberSelectionWidget:

Signals

void valueChanged (int newValue)
 Emitted when number is changed by user. More...
 
void upPressed ()
 Widget is not in editing mode and user pressed "up". More...
 
void downPressed ()
 Widget is not in editing mode and user pressed "up". More...
 

Public Member Functions

 NumberSelectionWidget (int defaultValue, int digits, int separator, int height, QWidget *parent=0)
 Constructor. More...
 
int value () const
 Returns current entered number. More...
 
void setValue (int value)
 Sets current value. Does not emit valueChanged() signal. More...
 
bool hasFocusInside ()
 True, if widget or one of its children has keyboard input focus. More...
 

Protected Member Functions

void keyPressEvent (QKeyEvent *event) override
 
void focusInEvent (QFocusEvent *event) override
 

Detailed Description

Widget that allows to input integer numbers using robot keys.

Constructor & Destructor Documentation

NumberSelectionWidget::NumberSelectionWidget ( int  defaultValue,
int  digits,
int  separator,
int  height,
QWidget *  parent = 0 
)

Constructor.

Parameters
defaultValue- number that will be shown in this widget initially.
digits- required quantity of selectable digits in a number.
separator- a number of digits that shall be separated by '.'. For example, if "separator" value is 3 and "digits" value is 9, number will be shown as "999.999.999".
height- height of digits in pixels.
parent- parent of this widget in terms of Qt widges parent/son relations.

Member Function Documentation

void trikGui::NumberSelectionWidget::downPressed ( )
signal

Widget is not in editing mode and user pressed "up".

Event propagation to parent widget does not work for some reason in this case.

void NumberSelectionWidget::focusInEvent ( QFocusEvent *  event)
overrideprotected
bool NumberSelectionWidget::hasFocusInside ( )

True, if widget or one of its children has keyboard input focus.

void NumberSelectionWidget::keyPressEvent ( QKeyEvent *  event)
overrideprotected
void NumberSelectionWidget::setValue ( int  value)

Sets current value. Does not emit valueChanged() signal.

void trikGui::NumberSelectionWidget::upPressed ( )
signal

Widget is not in editing mode and user pressed "up".

Event propagation to parent widget does not work for some reason in this case.

int NumberSelectionWidget::value ( ) const

Returns current entered number.

void trikGui::NumberSelectionWidget::valueChanged ( int  newValue)
signal

Emitted when number is changed by user.


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