Stellarium 0.15.2
|
A spin box for displaying/entering angular values. More...
#include <AngleSpinBox.hpp>
Public Types | |
enum | DisplayFormat { DMSLetters, DMSSymbols, DMSLettersUnsigned, DMSSymbolsUnsigned, HMSLetters, HMSSymbols, DecimalDeg } |
Used to decide how to display the angle. More... | |
enum | PrefixType { Normal, NormalPlus, Longitude, Latitude, Unknown } |
Determines how positive and negative values are indicated. More... | |
Public Slots | |
virtual void | clear () |
Set the value to default 0 angle. More... | |
void | setRadians (double radians) |
Set the value of the spin box in radians. More... | |
void | setDegrees (double degrees) |
Set the value of the spin box in decimal degrees. More... | |
Signals | |
void | valueChanged () |
Emitted when the value changes. More... | |
Public Member Functions | |
AngleSpinBox (QWidget *parent=0, DisplayFormat format=DMSSymbols, PrefixType prefix=Normal) | |
virtual void | stepBy (int steps) |
virtual QValidator::State | validate (QString &input, int &pos) const |
double | valueRadians () |
Get the angle held in the AngleSpinBox. More... | |
double | valueDegrees () |
Get the angle held in the AngleSpinBox. More... | |
void | setDecimals (int places) |
Set the number of decimal places to express float values to (e.g. More... | |
int | decimals () |
Get the number of decimal places to express float values to (e.g. More... | |
void | setDisplayFormat (DisplayFormat format) |
Set the display format. More... | |
DisplayFormat | displayFormat () |
Get the current display format. More... | |
void | setPrefixType (PrefixType prefix) |
Set the prefix type. More... | |
PrefixType | prefixType () |
Get the current display format. More... | |
void | setMinimum (const double min, const bool isDegrees=false) |
Set the minimum value. More... | |
double | getMinimum (const bool isDegrees) |
Get the minimum value. More... | |
void | setMaximum (const double max, const bool isDegrees=false) |
Set the maximum value. More... | |
double | getMaximum (const bool isDegrees) |
Get the maximum value. More... | |
Protected Member Functions | |
virtual StepEnabled | stepEnabled () const |
A spin box for displaying/entering angular values.
This class can accept angles in various formats commonly used in astronomy including decimal degrees, DMS and HMS. You should set upper and lower limits (maximum, minimum) and decide whether the values wrap around or are blocked at the limits (wrapping).
Definition at line 34 of file AngleSpinBox.hpp.
Used to decide how to display the angle.
Definition at line 41 of file AngleSpinBox.hpp.
Determines how positive and negative values are indicated.
Definition at line 54 of file AngleSpinBox.hpp.
|
virtualslot |
Set the value to default 0 angle.
|
inline |
Get the number of decimal places to express float values to (e.g.
seconds in DMSLetters format).
Definition at line 83 of file AngleSpinBox.hpp.
|
inline |
Get the current display format.
Definition at line 91 of file AngleSpinBox.hpp.
|
inline |
Get the maximum value.
isDegrees | true if the maximum value is required in degrees, else max is returned as radians. |
Definition at line 117 of file AngleSpinBox.hpp.
|
inline |
Get the minimum value.
isDegrees | true if the minimum value is required in degrees, else min is returned as radians. |
Definition at line 108 of file AngleSpinBox.hpp.
|
inline |
Get the current display format.
Definition at line 99 of file AngleSpinBox.hpp.
|
inline |
Set the number of decimal places to express float values to (e.g.
seconds in DMSLetters format).
places | the number of decimal places to use. |
Definition at line 79 of file AngleSpinBox.hpp.
|
slot |
Set the value of the spin box in decimal degrees.
degrees | the value to set, in decimal degrees. |
|
inline |
Set the display format.
format | the new format to use. |
Definition at line 87 of file AngleSpinBox.hpp.
|
inline |
Set the maximum value.
max | the new maximum value |
isDegrees | true if the new maximum value is given in degrees, else max is understood as radians. |
Definition at line 113 of file AngleSpinBox.hpp.
|
inline |
Set the minimum value.
min | the new minimum value |
isDegrees | true if the new minimum value is given in degrees, else min is understood as radians. |
Definition at line 104 of file AngleSpinBox.hpp.
|
inline |
Set the prefix type.
prefix | the new prefix type to use. |
Definition at line 95 of file AngleSpinBox.hpp.
|
slot |
Set the value of the spin box in radians.
radians | the value to set, in radians. |
|
signal |
Emitted when the value changes.
double AngleSpinBox::valueDegrees | ( | ) |
Get the angle held in the AngleSpinBox.
double AngleSpinBox::valueRadians | ( | ) |
Get the angle held in the AngleSpinBox.