AngleSelector

Search for usage in LXR

AngleSelector Class Reference

#include <AngleSelector.h>

Inheritance diagram for AngleSelector:

Signals

void angleChanged (qreal angle)
 

Public Slots

qreal angle () const
 
qreal closestCoterminalAngleInRange (qreal angle, bool *ok=nullptr) const
 
static qreal closestCoterminalAngleInRange (qreal angle, qreal minimum, qreal maximum, bool *ok=nullptr)
 
int decimals () const
 
void flip (Qt::Orientations orientations)
 
static qreal flipAngle (qreal angle, qreal minimum, qreal maximum, Qt::Orientations orientations, bool *ok=nullptr)
 
static qreal flipAngle (qreal angle, Qt::Orientations orientations)
 
QString flipOptionsMode () const
 
QString increasingDirection () const
 
bool isUsingFlatSpinBox () const
 
qreal maximum () const
 
qreal minimum () const
 
QString prefix () const
 
void reset ()
 
qreal resetAngle () const
 
void setAngle (qreal newAngle)
 
void setDecimals (int newNumberOfDecimals)
 
void setFlipOptionsMode (QString newMode)
 
void setIncreasingDirection (QString newIncreasingDirection)
 
void setMaximum (qreal newMaximum)
 
void setMinimum (qreal newMinimum)
 
void setPrefix (const QString &newPrefix)
 
void setRange (qreal newMinimum, qreal newMaximum)
 
void setResetAngle (qreal newResetAngle)
 
void setSnapAngle (qreal newSnapAngle)
 
void setWidgetsHeight (int newHeight)
 
void setWrapping (bool newWrapping)
 
qreal snapAngle () const
 
void useFlatSpinBox (bool newUseFlatSpinBox)
 
QWidgetwidget () const
 
int widgetsHeight () const
 
bool wrapping () const
 

Additional Inherited Members

- Public Types inherited from QObject
typedef  QObjectList
 
- Properties inherited from QObject
 objectName
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
QBindable< QStringbindableObjectName ()
 
bool blockSignals (bool block)
 
const QObjectListchildren () const const
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method) const const
 
bool disconnect (const QObject *receiver, const char *method) const const
 
void dumpObjectInfo () const const
 
void dumpObjectTree () const const
 
QList< QByteArraydynamicPropertyNames () const const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
findChild (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QRegularExpression &re, Qt::FindChildOptions options) const const
 
QList< T > findChildren (const QString &name, Qt::FindChildOptions options) const const
 
QList< T > findChildren (Qt::FindChildOptions options) const const
 
bool inherits (const char *className) const const
 
void installEventFilter (QObject *filterObj)
 
bool isQuickItemType () const const
 
bool isWidgetType () const const
 
bool isWindowType () const const
 
void killTimer (int id)
 
virtual const QMetaObjectmetaObject () const const
 
void moveToThread (QThread *targetThread)
 
QString objectName () const const
 
void objectNameChanged (const QString &objectName)
 
QObjectparent () const const
 
QVariant property (const char *name) const const
 
 Q_CLASSINFO (Name, Value)
 
 Q_EMIT Q_EMIT
 
 Q_ENUM (...)
 
 Q_ENUM_NS (...)
 
 Q_ENUMS (...)
 
 Q_FLAG (...)
 
 Q_FLAG_NS (...)
 
 Q_FLAGS (...)
 
 Q_GADGET Q_GADGET
 
 Q_GADGET_EXPORT (EXPORT_MACRO)
 
 Q_INTERFACES (...)
 
 Q_INVOKABLE Q_INVOKABLE
 
 Q_MOC_INCLUDE Q_MOC_INCLUDE
 
 Q_NAMESPACE Q_NAMESPACE
 
 Q_NAMESPACE_EXPORT (EXPORT_MACRO)
 
 Q_OBJECT Q_OBJECT
 
 Q_PROPERTY (...)
 
 Q_REVISION Q_REVISION
 
 Q_SET_OBJECT_NAME (Object)
 
 Q_SIGNAL Q_SIGNAL
 
 Q_SIGNALS Q_SIGNALS
 
 Q_SLOT Q_SLOT
 
 Q_SLOTS Q_SLOTS
 
qobject_cast (const QObject *object)
 
qobject_cast (QObject *object)
 
 QT_NO_NARROWING_CONVERSIONS_IN_CONNECT QT_NO_NARROWING_CONVERSIONS_IN_CONNECT
 
void removeEventFilter (QObject *obj)
 
void setObjectName (const QString &name)
 
void setObjectName (QAnyStringView name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool setProperty (const char *name, QVariant &&value)
 
bool signalsBlocked () const const
 
int startTimer (int interval, Qt::TimerType timerType)
 
int startTimer (std::chrono::milliseconds interval, Qt::TimerType timerType)
 
QThreadthread () const const
 
- Static Public Member Functions inherited from QObject
QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *context, Functor functor, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method, Qt::ConnectionType type)
 
QMetaObject::Connection connect (const QObject *sender, PointerToMemberFunction signal, Functor functor)
 
bool disconnect (const QMetaObject::Connection &connection)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
bool disconnect (const QObject *sender, PointerToMemberFunction signal, const QObject *receiver, PointerToMemberFunction method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
- Protected Member Functions inherited from QObject
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
bool isSignalConnected (const QMetaMethod &signal) const const
 
int receivers (const char *signal) const const
 
QObjectsender () const const
 
int senderSignalIndex () const const
 
virtual void timerEvent (QTimerEvent *event)
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ AngleSelector()

AngleSelector::AngleSelector ( )
explicit

Definition at line 29 of file AngleSelector.cpp.

◆ ~AngleSelector()

AngleSelector::~AngleSelector ( )
override

Definition at line 39 of file AngleSelector.cpp.

Member Function Documentation

◆ angle

qreal AngleSelector::angle ( ) const
slot

Gets the current angle.

Returns
The current angle
See also
setAngle(qreal)

Definition at line 49 of file AngleSelector.cpp.

◆ closestCoterminalAngleInRange [1/2]

qreal AngleSelector::closestCoterminalAngleInRange ( qreal angle,
bool * ok = nullptr ) const
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)

Parameters
angleThe reference angle for which the function will try to find a coterminal angle
[out]okThis parameter will be set to true if a coterminal angle exists in the specified range, or to false otherwise
Returns
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

Definition at line 204 of file AngleSelector.cpp.

◆ closestCoterminalAngleInRange [2/2]

qreal AngleSelector::closestCoterminalAngleInRange ( qreal angle,
qreal minimum,
qreal maximum,
bool * ok = nullptr )
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)

Parameters
angleThe reference angle for which the function will try to find a coterminal angle
minimumThe range's lower bound
maximumThe range's upper bound
[out]okThis parameter will be set to true if a coterminal angle exists in the provided range, or to false otherwise
Returns
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

Definition at line 199 of file AngleSelector.cpp.

◆ decimals

int AngleSelector::decimals ( ) const
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.

Returns
The number of decimals being used
See also
setDecimals(int)

Definition at line 64 of file AngleSelector.cpp.

◆ flip

void AngleSelector::flip ( Qt::Orientations orientations)
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

Parameters
orientationsFlags indicating in which directions the angle should be flipped

Definition at line 219 of file AngleSelector.cpp.

◆ flipAngle [1/2]

qreal AngleSelector::flipAngle ( qreal angle,
qreal minimum,
qreal maximum,
Qt::Orientations orientations,
bool * ok = nullptr )
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

Parameters
angleThe angle to be flipped
minimumThe lower bound of the valid range
maximumThe upper bound of the valid range
orientationsFlags indicating in which directions the angle should be flipped
[out]okThis parameter will be set to true if the flipped angle is in the provided range, or to false otherwise
Returns
The flipped angle if it lies in the provided range or the closest value in the range (the minimum or maximum) otherwise

Definition at line 214 of file AngleSelector.cpp.

◆ flipAngle [2/2]

qreal AngleSelector::flipAngle ( qreal angle,
Qt::Orientations orientations )
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

Parameters
angleThe angle to be flipped
orientationsFlags indicating in which directions the angle should be flipped
Returns
The flipped angle

Definition at line 209 of file AngleSelector.cpp.

◆ flipOptionsMode

QString AngleSelector::flipOptionsMode ( ) const
slot

Gets the mode in which the flip options should be shown.

The default is Buttons

Returns
The mode in which the flip options should be shown.
See also
setFlipOptionsMode(QString)

Definition at line 89 of file AngleSelector.cpp.

◆ increasingDirection

QString AngleSelector::increasingDirection ( ) const
slot

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

Returns
The direction in which the angle increases
See also
setIncreasingDirection(QString)

Definition at line 104 of file AngleSelector.cpp.

◆ isUsingFlatSpinBox

bool AngleSelector::isUsingFlatSpinBox ( ) const
slot

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

Returns
True if the spin box is flat, false otherwise
See also
useFlatSpinBox(bool)

Definition at line 114 of file AngleSelector.cpp.

◆ maximum

qreal AngleSelector::maximum ( ) const
slot

Gets the maximum value for the angle.

The default is 360

Returns
The maximum value for the angle
See also
setMaximum(qreal)
setRange(qreal, qreal)

Definition at line 69 of file AngleSelector.cpp.

◆ minimum

qreal AngleSelector::minimum ( ) const
slot

Gets the minimum value for the angle.

The default is 0

Returns
The minimum value for the angle
See also
setMinimum(qreal)
setRange(qreal, qreal)

Definition at line 74 of file AngleSelector.cpp.

◆ prefix

QString AngleSelector::prefix ( ) const
slot

Gets the prefix shown in the spin box.

Returns
The prefix shown in the spin box
See also
setPrefix(const QString&)

Definition at line 79 of file AngleSelector.cpp.

◆ reset

void AngleSelector::reset ( )
slot

Sets the current angle to the reset angle.

See also
resetAngle() const
setResetAngle(qreal) const

Definition at line 194 of file AngleSelector.cpp.

◆ resetAngle

qreal AngleSelector::resetAngle ( ) const
slot

Gets the angle that is used to reset the current angle.

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

Returns
The angle that is used to reset the current angle
See also
setResetAngle(qreal)

Definition at line 59 of file AngleSelector.cpp.

◆ setAngle

void AngleSelector::setAngle ( qreal newAngle)
slot

Sets the current angle.

Parameters
newAnglethe new angle
See also
angle() const

Definition at line 119 of file AngleSelector.cpp.

◆ setDecimals

void AngleSelector::setDecimals ( int newNumberOfDecimals)
slot

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

Parameters
newNumberOfDecimalsthe new number of decimals used by the angle
See also
decimals() const

Definition at line 134 of file AngleSelector.cpp.

◆ setFlipOptionsMode

void AngleSelector::setFlipOptionsMode ( QString newMode)
slot

Sets the mode in which the flip options should be shown.

Parameters
newModethe 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
    flipOptionsMode() const

Definition at line 164 of file AngleSelector.cpp.

◆ setIncreasingDirection

void AngleSelector::setIncreasingDirection ( QString newIncreasingDirection)
slot

Sets the increasing direction in the angle gauge.

Parameters
newIncreasingDirectionThe new increasing direction Valid arguments: CounterClockwise or Clockwise.
See also
increasingDirection() const

Definition at line 179 of file AngleSelector.cpp.

◆ setMaximum

void AngleSelector::setMaximum ( qreal newMaximum)
slot

Sets the maximum value for the angle.

Parameters
newMaximumthe new maximum value for the angle
See also
maximum() const
setRange(qreal, qreal)

Definition at line 139 of file AngleSelector.cpp.

◆ setMinimum

void AngleSelector::setMinimum ( qreal newMinimum)
slot

Sets the minimum value for the angle.

Parameters
newMinimumthe new minimum value for the angle
See also
minimum() const
setRange(qreal, qreal)

Definition at line 144 of file AngleSelector.cpp.

◆ setPrefix

void AngleSelector::setPrefix ( const QString & newPrefix)
slot

Sets the prefix shown in the spin box.

Parameters
newPrefixthe new prefix for the spin box
See also
prefix() const

Definition at line 154 of file AngleSelector.cpp.

◆ setRange

void AngleSelector::setRange ( qreal newMinimum,
qreal newMaximum )
slot

Sets the minimum and maximum values for the angle.

Parameters
newMinimumthe new minimum value for the angle
newMaximumthe new maximum value for the angle
See also
minimum() const
maximum() const
setMinimum(qreal)
setMaximum(qreal)

Definition at line 149 of file AngleSelector.cpp.

◆ setResetAngle

void AngleSelector::setResetAngle ( qreal newResetAngle)
slot

Sets the angle that is used to reset the current angle.

Parameters
newResetAnglethe new angle that is used to reset the current angle
See also
resetAngle() const

Definition at line 129 of file AngleSelector.cpp.

◆ setSnapAngle

void AngleSelector::setSnapAngle ( qreal newSnapAngle)
slot

Sets the angle to which multiples the selected angle will snap.

Parameters
newSnapAnglethe new angle to which multiples the selected angle will snap
See also
snapAngle() const

Definition at line 124 of file AngleSelector.cpp.

◆ setWidgetsHeight

void AngleSelector::setWidgetsHeight ( int newHeight)
slot

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

Use 0 to reset widgets to default height.

Parameters
newHeightthe new height of the internal widgets (angle gauge, spin box, etc.)
See also
widgetsHeight() const

Definition at line 174 of file AngleSelector.cpp.

◆ setWrapping

void AngleSelector::setWrapping ( bool newWrapping)
slot

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

Parameters
newWrappingtrue if the angle should wrap pass the minimum or maximum angles, false otherwise
See also
wrapping() const

Definition at line 159 of file AngleSelector.cpp.

◆ snapAngle

qreal AngleSelector::snapAngle ( ) const
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.)

Returns
The angle to which multiples the selected angle will snap
See also
setSnapAngle(qreal)

Definition at line 54 of file AngleSelector.cpp.

◆ useFlatSpinBox

void AngleSelector::useFlatSpinBox ( bool newUseFlatSpinBox)
slot

Sets if the spin box should be flat.

Parameters
newUseFlatSpinBoxTrue if the spin box should be flat, false otherwise
See also
isUsingFlatSpinBox() const

Definition at line 189 of file AngleSelector.cpp.

◆ widget

QWidget * AngleSelector::widget ( ) const
slot

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

Returns
the internal KisAngleSelector as a QWidget

Definition at line 44 of file AngleSelector.cpp.

◆ widgetsHeight

int AngleSelector::widgetsHeight ( ) const
slot

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

Returns
The height of the internal widgets (angle gauge, spin box, etc.). Returns 0 if each widget has its default height.
See also
setWidgetsHeight(int)

Definition at line 99 of file AngleSelector.cpp.

◆ wrapping

bool AngleSelector::wrapping ( ) const
slot

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

Returns
True if the angle should wrap pass the minimum or maximum angles, false otherwise
See also
setWrapping(bool)

Definition at line 84 of file AngleSelector.cpp.


The documentation for this class was generated from the following files:
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Oct 11 2024 12:13:07 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.