Class AngleSelector
Build from AngleSelector.h
Krita master

A wrapper around KisAngleSelector, a widget with several options to select an angle. The widget itself is accessed with the widget() function.

This widget is a combination of a KisAngleGauge and a spin box, along with some flipping options

Static methods

closestCoterminalAngleInRange(angle: float, minimum: float, maximum: float, ok: bool = False)float flipAngle(angle: float, orientations: Qt.Orientations)float flipAngle(angle: float, minimum: float, maximum: float, orientations: Qt.Orientations, ok: bool = False)float

Methods

angle()float closestCoterminalAngleInRange(angle: float, ok: bool = False)float decimals()int flip(orientations: Qt.Orientations) flipOptionsMode()str increasingDirection()str isUsingFlatSpinBox()bool maximum()float minimum()float prefix()str reset() resetAngle()float setAngle(newAngle: float) setDecimals(newNumberOfDecimals: int) setFlipOptionsMode(newMode: str) setIncreasingDirection(newIncreasingDirection: str) setMaximum(newMaximum: float) setMinimum(newMinimum: float) setPrefix(newPrefix: str) setRange(newMinimum: float, newMaximum: float) setResetAngle(newResetAngle: float) setSnapAngle(newSnapAngle: float) setWidgetsHeight(newHeight: int) setWrapping(newWrapping: bool) snapAngle()float useFlatSpinBox(newUseFlatSpinBox: bool) widget()QWidget widgetsHeight()int wrapping()bool

Signals

angleChanged(float)

Member documentation

angle()float
Krita master

Gets the current angle

Return

The current angle

🢒 See setAngle()
angleChanged(float)
Krita master

Parameters

angle(no description provided)
closestCoterminalAngleInRange(angle: float, minimum: float, maximum: float, ok: bool = False)float
Krita master

Gets the closest coterminal angle to the provided angle that is in the range provided

A coterminal angle to the provided angle is one that differs in size by an integer multiple of a turn (360 degrees)

Parameters

angle

The reference angle for which the function will try to find a coterminal angle

minimum

The range's lower bound

maximum

The range's upper bound @param[out] ok This parameter will be set to true if a coterminal angle exists in the provided range, or to false otherwise

ok(no description provided)

Return

The closest coterminal angle in the provided range if one exists, or the closest value in the range (the minimum or maximum) otherwise. If the reference angle is already in the range then it is returned

closestCoterminalAngleInRange(angle: float, ok: bool = False)float
Krita master

Gets the closest coterminal angle to the provided angle that is in the range established

A coterminal angle to the provided angle is one that differs in size by an integer multiple of a turn (360 degrees)

Parameters

angle

The reference angle for which the function will try to find a coterminal angle @param[out] ok This parameter will be set to true if a coterminal angle exists in the specified range, or to false otherwise

ok(no description provided)

Return

The closest coterminal angle in the specified range if one exists, or the closest value in the range (the minimum or maximum) otherwise. If the reference angle is already in the range then it is returned

decimals()int
Krita master

Gets the number of decimals (precision) used by the angle

If you want to simulate integer angles, set it to 0. The default is 2.

Return

The number of decimals being used

🢒 See setDecimals()
flip(orientations: Qt.Orientations)
Krita master

Flips the angle horizontally, vertically, or both

This function will always try to set the closest angle to the stablished one that satisfies the flipping requirements

Parameters

orientations

Flags indicating in which directions the angle should be flipped

flipAngle(angle: float, orientations: Qt.Orientations)float
Krita master

Flips an angle horizontally, vertically, or both

This function will always try to get the closest angle to the provided one that satisfies the flipping requirements

Parameters

angle

The angle to be flipped

orientations

Flags indicating in which directions the angle should be flipped

Return

The flipped angle

flipAngle(angle: float, minimum: float, maximum: float, orientations: Qt.Orientations, ok: bool = False)float
Krita master

Flips an angle horizontally, vertically, or both

This function will always try to get the closest angle to the provided one that satisfies the flipping requirements

Parameters

angle

The angle to be flipped

minimum

The lower bound of the valid range

maximum

The upper bound of the valid range

orientations

Flags indicating in which directions the angle should be flipped @param[out] ok This parameter will be set to true if the flipped angle is in the provided range, or to false otherwise

ok(no description provided)

Return

The flipped angle if it lies in the provided range or the closest value in the range (the minimum or maximum) otherwise

flipOptionsMode()str
Krita master

Gets the mode in which the flip options should be shown

The default is Buttons

Return

The mode in which the flip options should be shown.

Krita master

Gets the direction in which the angle increases in the angle gauge

Return

The direction in which the angle increases

isUsingFlatSpinBox()bool
Krita master

Gets if the spin box is flat (no border or background)

Return

True if the spin box is flat, false otherwise

🢒 See useFlatSpinBox()
maximum()float
Krita master

Gets the maximum value for the angle

The default is 360

Return

The maximum value for the angle

🢒 See setRange()
minimum()float
Krita master

Gets the minimum value for the angle

The default is 0

Return

The minimum value for the angle

🢒 See setRange()
prefix()str
Krita master

Gets the prefix shown in the spin box

Return

The prefix shown in the spin box

🢒 See setPrefix()
reset()
Krita master

Sets the current angle to the reset angle

resetAngle()float
Krita master

Gets the angle that is used to reset the current angle

This angle is used when the user double clicks on the widget

Return

The angle that is used to reset the current angle

🢒 See setResetAngle()
setAngle(newAngle: float)
Krita master

Sets the current angle

Parameters

newAngle

the new angle

setDecimals(newNumberOfDecimals: int)
Krita master

Sets the number of decimals (precision) used by the angle

Parameters

newNumberOfDecimals

the new number of decimals used by the angle

setFlipOptionsMode(newMode: str)
Krita master

Sets the mode in which the flip options should be shown

Parameters

newMode

the new mode in which the flip options should be shown Valid arguments:

  • NoFlipOptions - There are no flip options available
  • MenuButton - The flip options are shown as a menu accessible via a options button
  • Buttons - The flip options are shown as individual buttons
  • ContextMenu - The flip options are shown only as a context menu when right-clicking the gauge widget
setIncreasingDirection(newIncreasingDirection: str)
Krita master

Sets the increasing direction in the angle gauge

Parameters

newIncreasingDirection

The new increasing direction Valid arguments: CounterClockwise or Clockwise.

setMaximum(newMaximum: float)
Krita master

Sets the maximum value for the angle

Parameters

newMaximum

the new maximum value for the angle

🢒 See setRange()
setMinimum(newMinimum: float)
Krita master

Sets the minimum value for the angle

Parameters

newMinimum

the new minimum value for the angle

🢒 See setRange()
setPrefix(newPrefix: str)
Krita master

Sets the prefix shown in the spin box

Parameters

newPrefix

the new prefix for the spin box

setRange(newMinimum: float, newMaximum: float)
Krita master

Sets the minimum and maximum values for the angle

Parameters

newMinimum

the new minimum value for the angle

newMaximum

the new maximum value for the angle

🢒 See setMaximum()
setResetAngle(newResetAngle: float)
Krita master

Sets the angle that is used to reset the current angle

Parameters

newResetAngle

the new angle that is used to reset the current angle

setSnapAngle(newSnapAngle: float)
Krita master

Sets the angle to which multiples the selected angle will snap

Parameters

newSnapAngle

the new angle to which multiples the selected angle will snap

setWidgetsHeight(newHeight: int)
Krita master

Sets the common height of the widgets inside this angle selector.

Use 0 to reset widgets to default height.

Parameters

newHeight

the new height of the internal widgets (angle gauge, spin box, etc.)

setWrapping(newWrapping: bool)
Krita master

Sets if the angle should wrap pass the minimum or maximum angles

Parameters

newWrapping

true if the angle should wrap pass the minimum or maximum angles, false otherwise

snapAngle()float
Krita master

Gets the angle to which multiples the selected angle will snap

The default snap angle is 15 degrees so the selected angle will snap to its multiples (0, 15, 30, 45, etc.)

Return

The angle to which multiples the selected angle will snap

🢒 See setSnapAngle()
useFlatSpinBox(newUseFlatSpinBox: bool)
Krita master

Sets if the spin box should be flat

Parameters

newUseFlatSpinBox

True if the spin box should be flat, false otherwise

widget()QWidget
Krita master

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

Return

the internal KisAngleSelector as a QWidget

widgetsHeight()int
Krita master

Gets the common height of the widgets inside this angle selector

Return

The height of the internal widgets (angle gauge, spin box, etc.).

Returns 0 if each widget has its default height.

🢒 See setWidgetsHeight()
wrapping()bool
Krita master

Gets if the angle should wrap pass the minimum or maximum angles

Return

True if the angle should wrap pass the minimum or maximum angles, false otherwise

🢒 See setWrapping()