|
Krita Source Code Documentation
|
A wrapper around KisAngleSelector, a widget with several options to select an angle. The widget itself is accessed with the widget() function. More...
#include <AngleSelector.h>
Inheritance diagram for AngleSelector:Public Slots | |
| qreal | angle () const |
| Gets the current angle. | |
| qreal | closestCoterminalAngleInRange (qreal angle, bool *ok=nullptr) const |
| Gets the closest coterminal angle to the provided angle that is in the range established. | |
| static qreal | closestCoterminalAngleInRange (qreal angle, qreal minimum, qreal maximum, bool *ok=nullptr) |
| Gets the closest coterminal angle to the provided angle that is in the range provided. | |
| int | decimals () const |
| Gets the number of decimals (precision) used by the angle. | |
| void | flip (Qt::Orientations orientations) |
| Flips the angle horizontally, vertically, or both. | |
| static qreal | flipAngle (qreal angle, qreal minimum, qreal maximum, Qt::Orientations orientations, bool *ok=nullptr) |
| Flips an angle horizontally, vertically, or both. | |
| static qreal | flipAngle (qreal angle, Qt::Orientations orientations) |
| Flips an angle horizontally, vertically, or both. | |
| QString | flipOptionsMode () const |
| Gets the mode in which the flip options should be shown. | |
| QString | increasingDirection () const |
| Gets the direction in which the angle increases in the angle gauge. | |
| bool | isUsingFlatSpinBox () const |
| Gets if the spin box is flat (no border or background) | |
| qreal | maximum () const |
| Gets the maximum value for the angle. | |
| qreal | minimum () const |
| Gets the minimum value for the angle. | |
| QString | prefix () const |
| Gets the prefix shown in the spin box. | |
| void | reset () |
| Sets the current angle to the reset angle. | |
| qreal | resetAngle () const |
| Gets the angle that is used to reset the current angle. | |
| void | setAngle (qreal newAngle) |
| Sets the current angle. | |
| void | setDecimals (int newNumberOfDecimals) |
| Sets the number of decimals (precision) used by the angle. | |
| void | setFlipOptionsMode (QString newMode) |
| Sets the mode in which the flip options should be shown. | |
| void | setIncreasingDirection (QString newIncreasingDirection) |
| Sets the increasing direction in the angle gauge. | |
| void | setMaximum (qreal newMaximum) |
| Sets the maximum value for the angle. | |
| void | setMinimum (qreal newMinimum) |
| Sets the minimum value for the angle. | |
| void | setPrefix (const QString &newPrefix) |
| Sets the prefix shown in the spin box. | |
| void | setRange (qreal newMinimum, qreal newMaximum) |
| Sets the minimum and maximum values for the angle. | |
| void | setResetAngle (qreal newResetAngle) |
| Sets the angle that is used to reset the current angle. | |
| void | setSnapAngle (qreal newSnapAngle) |
| Sets the angle to which multiples the selected angle will snap. | |
| void | setWidgetsHeight (int newHeight) |
| Sets the common height of the widgets inside this angle selector. Use 0 to reset widgets to default height. | |
| void | setWrapping (bool newWrapping) |
| Sets if the angle should wrap pass the minimum or maximum angles. | |
| qreal | snapAngle () const |
| Gets the angle to which multiples the selected angle will snap. | |
| void | useFlatSpinBox (bool newUseFlatSpinBox) |
| Sets if the spin box should be flat. | |
| QWidget * | widget () const |
| Get the internal KisAngleSelector as a QWidget, so it may be added to a UI. | |
| int | widgetsHeight () const |
| Gets the common height of the widgets inside this angle selector. | |
| bool | wrapping () const |
| Gets if the angle should wrap pass the minimum or maximum angles. | |
Signals | |
| void | angleChanged (qreal angle) |
Public Member Functions | |
| AngleSelector () | |
| ~AngleSelector () override | |
Private Attributes | |
| Private *const | d |
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
Definition at line 21 of file AngleSelector.h.
|
explicit |
Definition at line 29 of file AngleSelector.cpp.
References angleChanged(), connect(), d, and krita::AngleSelector::Private::widget.
|
override |
|
slot |
Gets the current angle.
Definition at line 49 of file AngleSelector.cpp.
References KisAngleSelector::angle(), d, and krita::AngleSelector::Private::widget.
|
signal |
|
slot |
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)
| angle | The reference angle for which the function will try to find a coterminal angle | |
| [out] | ok | This parameter will be set to true if a coterminal angle exists in the specified range, or to false otherwise |
Definition at line 204 of file AngleSelector.cpp.
References angle(), KisAngleSelector::closestCoterminalAngleInRange(), d, and krita::AngleSelector::Private::widget.
|
staticslot |
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)
| 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 | |
| [out] | ok | This parameter will be set to true if a coterminal angle exists in the provided range, or to false otherwise |
Definition at line 199 of file AngleSelector.cpp.
References angle(), KisAngleSelector::closestCoterminalAngleInRange(), maximum(), and minimum().
|
slot |
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.
Definition at line 64 of file AngleSelector.cpp.
References d, KisAngleSelector::decimals(), and krita::AngleSelector::Private::widget.
|
slot |
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
| orientations | Flags indicating in which directions the angle should be flipped |
Definition at line 219 of file AngleSelector.cpp.
References angle(), flipAngle(), maximum(), minimum(), and setAngle().
|
staticslot |
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
| 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 | |
| [out] | ok | This parameter will be set to true if the flipped angle is in the provided range, or to false otherwise |
Definition at line 214 of file AngleSelector.cpp.
References angle(), KisAngleSelector::flipAngle(), maximum(), and minimum().
|
staticslot |
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
| angle | The angle to be flipped |
| orientations | Flags indicating in which directions the angle should be flipped |
Definition at line 209 of file AngleSelector.cpp.
References angle(), and KisAngleSelector::flipAngle().
|
slot |
Gets the mode in which the flip options should be shown.
The default is Buttons
Definition at line 89 of file AngleSelector.cpp.
References d, FlipOptionsMode, KisAngleSelector::flipOptionsMode(), warnScript, and krita::AngleSelector::Private::widget.
|
slot |
Gets the direction in which the angle increases in the angle gauge.
Definition at line 104 of file AngleSelector.cpp.
References d, IncreasingDirection, increasingDirection(), KisAngleSelector::increasingDirection(), warnScript, and krita::AngleSelector::Private::widget.
|
slot |
Gets if the spin box is flat (no border or background)
Definition at line 114 of file AngleSelector.cpp.
References d, KisAngleSelector::isUsingFlatSpinBox(), and krita::AngleSelector::Private::widget.
|
slot |
Gets the maximum value for the angle.
The default is 360
Definition at line 69 of file AngleSelector.cpp.
References d, KisAngleSelector::maximum(), and krita::AngleSelector::Private::widget.
|
slot |
Gets the minimum value for the angle.
The default is 0
Definition at line 74 of file AngleSelector.cpp.
References d, KisAngleSelector::minimum(), and krita::AngleSelector::Private::widget.
|
slot |
Gets the prefix shown in the spin box.
Definition at line 79 of file AngleSelector.cpp.
References d, KisAngleSelector::prefix(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the current angle to the reset angle.
Definition at line 194 of file AngleSelector.cpp.
References d, KisAngleSelector::reset(), and krita::AngleSelector::Private::widget.
|
slot |
Gets the angle that is used to reset the current angle.
This angle is used when the user double clicks on the widget
Definition at line 59 of file AngleSelector.cpp.
References d, KisAngleSelector::resetAngle(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the current angle.
| newAngle | the new angle |
Definition at line 119 of file AngleSelector.cpp.
References d, KisAngleSelector::setAngle(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the number of decimals (precision) used by the angle.
| newNumberOfDecimals | the new number of decimals used by the angle |
Definition at line 134 of file AngleSelector.cpp.
References d, KisAngleSelector::setDecimals(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the mode in which the flip options should be shown.
| newMode | the new mode in which the flip options should be shown Valid arguments:
|
Definition at line 164 of file AngleSelector.cpp.
References d, dbgScript, FlipOptionsMode, KisAngleSelector::setFlipOptionsMode(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the increasing direction in the angle gauge.
| newIncreasingDirection | The new increasing direction Valid arguments: CounterClockwise or Clockwise. |
Definition at line 179 of file AngleSelector.cpp.
References d, dbgScript, IncreasingDirection, KisAngleSelector::setIncreasingDirection(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the maximum value for the angle.
| newMaximum | the new maximum value for the angle |
Definition at line 139 of file AngleSelector.cpp.
References d, KisAngleSelector::setMaximum(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the minimum value for the angle.
| newMinimum | the new minimum value for the angle |
Definition at line 144 of file AngleSelector.cpp.
References d, KisAngleSelector::setMinimum(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the prefix shown in the spin box.
| newPrefix | the new prefix for the spin box |
Definition at line 154 of file AngleSelector.cpp.
References d, KisAngleSelector::setPrefix(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the minimum and maximum values for the angle.
| newMinimum | the new minimum value for the angle |
| newMaximum | the new maximum value for the angle |
Definition at line 149 of file AngleSelector.cpp.
References d, KisAngleSelector::setRange(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the angle that is used to reset the current angle.
| newResetAngle | the new angle that is used to reset the current angle |
Definition at line 129 of file AngleSelector.cpp.
References d, KisAngleSelector::setResetAngle(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the angle to which multiples the selected angle will snap.
| newSnapAngle | the new angle to which multiples the selected angle will snap |
Definition at line 124 of file AngleSelector.cpp.
References d, KisAngleSelector::setSnapAngle(), and krita::AngleSelector::Private::widget.
|
slot |
Sets the common height of the widgets inside this angle selector. Use 0 to reset widgets to default height.
| newHeight | the new height of the internal widgets (angle gauge, spin box, etc.) |
Definition at line 174 of file AngleSelector.cpp.
References d, KisAngleSelector::setWidgetsHeight(), and krita::AngleSelector::Private::widget.
|
slot |
Sets if the angle should wrap pass the minimum or maximum angles.
| newWrapping | true if the angle should wrap pass the minimum or maximum angles, false otherwise |
Definition at line 159 of file AngleSelector.cpp.
References d, KisAngleSelector::setWrapping(), and krita::AngleSelector::Private::widget.
|
slot |
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.)
Definition at line 54 of file AngleSelector.cpp.
References d, KisAngleSelector::snapAngle(), and krita::AngleSelector::Private::widget.
|
slot |
Sets if the spin box should be flat.
| newUseFlatSpinBox | True if the spin box should be flat, false otherwise |
Definition at line 189 of file AngleSelector.cpp.
References d, KisAngleSelector::useFlatSpinBox(), and krita::AngleSelector::Private::widget.
|
slot |
Get the internal KisAngleSelector as a QWidget, so it may be added to a UI.
Definition at line 44 of file AngleSelector.cpp.
References d, and krita::AngleSelector::Private::widget.
|
slot |
Gets the common height of the widgets inside this angle selector.
Definition at line 99 of file AngleSelector.cpp.
References d, krita::AngleSelector::Private::widget, and KisAngleSelector::widgetsHeight().
|
slot |
Gets if the angle should wrap pass the minimum or maximum angles.
Definition at line 84 of file AngleSelector.cpp.
References d, krita::AngleSelector::Private::widget, and KisAngleSelector::wrapping().
|
private |
Definition at line 308 of file AngleSelector.h.