Class IntParseSpinBox
Build from IntParseSpinBox.h
Krita master

A wrapper around KisIntParseSpinBox, which is a cleverer SpinBox, able to parse arithmetic expressions. The widget itself is accessed with the widget() function.

Use this spinbox instead of the basic one from Qt if you want it to be able to parse arithmetic expressions.

Methods

isLastValid()bool setValue(value: int, overwriteExpression: bool = False) stepBy(steps: int) widget()QSpinBox

Re-implemented methods

veryCleanText()str

Signals

errorWhileParsing(str) noMoreParsingError()

Member documentation

Krita master

signal emitted when the last parsed expression is not valid.

Parameters

expr(no description provided)
isLastValid()bool
Krita master

Get if the last expression entered is a valid one

Return

true if the last expression entered is valid
false otherwise

Krita master

signal emitted when the last parsed expression is valid and the expression before was not valid.

setValue(value: int, overwriteExpression: bool = False)
Krita master

Set the value of the spinbox

This reimplementation also tries to clear the current expression and warning message whenever possible. This will happen when the new value is different from the current one and the line edit has not the focus or it is read-only. One can force the reset also by passing true to the overwriteExpression parameter.

Parameters

value

The new value

overwriteExpression

Get if the expression in the edit field (and the warning message) should be reset to reflect the new value. The default is false so that if the user is editing the expression it won't be disrupted by any default call to this function

stepBy(steps: int)
Krita master

This is a reimplementation of QSpinBox::stepBy that uses setValue()

Parameters

steps

Number of steps that the value should change

veryCleanText()str
Krita master

This virtual function is similar to cleanText(). But child classes may reimplement it to further process ("clean up") the expression.

Return

The processed expression

widget()QSpinBox
Krita master

Get the internal KisIntParseSpinBox as a QWidget, so it may be added to a UI

Return

the internal KisIntParseSpinBox as a QWidget