Defines a position, using compass terminology. More...
#include <KDChartPosition.h>
Public Types | |
enum | Option { IncludeCenter = 0x1, IncludeFloating = 0x2 } |
Public Member Functions | |
bool | isCorner () const |
bool | isEastSide () const |
bool | isFloating () const |
bool | isNorthSide () const |
bool | isPole () const |
bool | isSouthSide () const |
bool | isUnknown () const |
bool | isWestSide () const |
const char * | name () const |
Returns a non-translated string in English language, corresponding to this Position. | |
bool | operator!= (int) const |
bool | operator!= (const Position &) const |
bool | operator== (int) const |
bool | operator== (const Position &) const |
Position (KDChartEnums::PositionValue value) | |
Constructor. | |
Position () | |
Default constructor. | |
QString | printableName () const |
Returns a translated string, corresponding to this Position. | |
KDChartEnums::PositionValue | value () const |
Returns an integer value corresponding to this Position. | |
Static Public Member Functions | |
static Position | fromName (const QByteArray &name) |
static Position | fromName (const char *name) |
static QList< QByteArray > | names (Options options=Options(IncludeCenter|IncludeFloating)) |
Returns a list of all string, corresponding to the pre-defined positions. | |
static QStringList | printableNames (Options options=Options(IncludeCenter|IncludeFloating)) |
Returns a list of all translated string, corresponding to the pre-defined positions. | |
Static Public Attributes | |
static const Position & | Center = staticPositionCenter |
static const Position & | East = staticPositionEast |
static const Position & | Floating = staticPositionFloating |
static const Position & | North = staticPositionNorth |
static const Position & | NorthEast = staticPositionNorthEast |
static const Position & | NorthWest = staticPositionNorthWest |
static const Position & | South = staticPositionSouth |
static const Position & | SouthEast = staticPositionSouthEast |
static const Position & | SouthWest = staticPositionSouthWest |
static const Position & | Unknown = staticPositionUnknown |
static const Position & | West = staticPositionWest |
Defines a position, using compass terminology.
Using KDChartPosition you can specify one of nine pre-defined, logical points (see the static
const
getter methods below), in a similar way, as you would use a compass to navigate on a map.
Position
together with the RelativePosition class, to specify a logical point, which then will be used to layout your chart at runtime, e.g. for specifying the location of a floating Legend box.switch( yourPosition().value() ) { case KDChartEnums::PositionNorthWest: // your code ... break; case KDChartEnums::PositionNorth: // your code ... break; }
Definition at line 67 of file KDChartPosition.h.
Definition at line 106 of file KDChartPosition.h.
Position::Position | ( | ) |
Default constructor.
Creates a new Position, defaulting it to Position::Unknown.
Definition at line 93 of file KDChartPosition.cpp.
Referenced by fromName().
Position::Position | ( | KDChartEnums::PositionValue | value | ) |
Constructor.
Creates a new Position, defaulting it to the respective value.
Valid values ranging from zero (unknown value) to 10. If invalid value is passed, a Position::Unknown is created.
* const KDChart::Position myPosition = KDChart::Position::NorthEast; *
Definition at line 117 of file KDChartPosition.cpp.
Position Position::fromName | ( | const QByteArray & | name | ) | [static] |
Definition at line 238 of file KDChartPosition.cpp.
References fromName().
Position Position::fromName | ( | const char * | name | ) | [static] |
Definition at line 230 of file KDChartPosition.cpp.
References Position().
Referenced by fromName().
bool Position::isCorner | ( | ) | const |
Definition at line 161 of file KDChartPosition.cpp.
References value().
bool Position::isEastSide | ( | ) | const |
Definition at line 148 of file KDChartPosition.cpp.
References value().
bool Position::isFloating | ( | ) | const |
Definition at line 174 of file KDChartPosition.cpp.
References value().
Referenced by KDChart::Chart::reLayoutFloatingLegends().
bool Position::isNorthSide | ( | ) | const |
Definition at line 142 of file KDChartPosition.cpp.
References value().
bool Position::isPole | ( | ) | const |
Definition at line 168 of file KDChartPosition.cpp.
References value().
bool Position::isSouthSide | ( | ) | const |
Definition at line 154 of file KDChartPosition.cpp.
References value().
bool Position::isUnknown | ( | ) | const |
Definition at line 131 of file KDChartPosition.cpp.
References value().
bool Position::isWestSide | ( | ) | const |
Definition at line 136 of file KDChartPosition.cpp.
References value().
const char * Position::name | ( | ) | const |
Returns a non-translated string in English language, corresponding to this Position.
Definition at line 182 of file KDChartPosition.cpp.
Referenced by operator<<().
QList< QByteArray > Position::names | ( | Options | options = Options(IncludeCenter | IncludeFloating) |
) | [static] |
Returns a list of all string, corresponding to the pre-defined positions.
options | if set to ExcludeCenter , the returned list does not contain the Center position. |
Definition at line 203 of file KDChartPosition.cpp.
References IncludeCenter, and IncludeFloating.
bool KDChart::Position::operator!= | ( | int | other | ) | const |
Definition at line 131 of file KDChartPosition.h.
References operator==().
bool KDChart::Position::operator!= | ( | const Position & | other | ) | const |
Definition at line 130 of file KDChartPosition.h.
References KDGantt::operator==().
bool Position::operator== | ( | int | value_ | ) | const |
Definition at line 248 of file KDChartPosition.cpp.
References value().
bool Position::operator== | ( | const Position & | r | ) | const |
QString Position::printableName | ( | ) | const |
Returns a translated string, corresponding to this Position.
Definition at line 190 of file KDChartPosition.cpp.
Referenced by printableNames().
QStringList Position::printableNames | ( | Options | options = Options(IncludeCenter | IncludeFloating) |
) | [static] |
Returns a list of all translated string, corresponding to the pre-defined positions.
options | if set to ExcludeCenter , the returned list does not contain the Center position. |
Definition at line 220 of file KDChartPosition.cpp.
References IncludeCenter, IncludeFloating, and printableName().
KDChartEnums::PositionValue Position::value | ( | ) | const |
Returns an integer value corresponding to this Position.
Definition at line 126 of file KDChartPosition.cpp.
Referenced by isCorner(), isEastSide(), isFloating(), isNorthSide(), isPole(), isSouthSide(), isUnknown(), isWestSide(), operator==(), KDChart::TernaryAxis::setPosition(), KDChart::PolarDiagram::setShowDelimitersAtPosition(), KDChart::PolarDiagram::setShowLabelsAtPosition(), KDChart::PolarDiagram::showDelimitersAtPosition(), and KDChart::PolarDiagram::showLabelsAtPosition().
const Position & Position::Center = staticPositionCenter [static] |
Definition at line 93 of file KDChartPosition.h.
Referenced by KDChart::PolarDiagram::paint(), and KDChart::PositionPoints::point().
const Position & Position::East = staticPositionEast [static] |
Definition at line 97 of file KDChartPosition.h.
Referenced by KDChart::PositionPoints::point().
const Position & Position::Floating = staticPositionFloating [static] |
Definition at line 103 of file KDChartPosition.h.
Referenced by KDChart::Legend::setFloatingPosition().
const Position & Position::North = staticPositionNorth [static] |
Definition at line 95 of file KDChartPosition.h.
Referenced by KDChart::PositionPoints::point().
const Position & Position::NorthEast = staticPositionNorthEast [static] |
Definition at line 96 of file KDChartPosition.h.
Referenced by KDChart::PositionPoints::point().
const Position & Position::NorthWest = staticPositionNorthWest [static] |
Definition at line 94 of file KDChartPosition.h.
Referenced by KDChart::PositionPoints::point().
const Position & Position::South = staticPositionSouth [static] |
Definition at line 99 of file KDChartPosition.h.
Referenced by KDChart::PositionPoints::point().
const Position & Position::SouthEast = staticPositionSouthEast [static] |
Definition at line 98 of file KDChartPosition.h.
Referenced by KDChart::PositionPoints::point().
const Position & Position::SouthWest = staticPositionSouthWest [static] |
Definition at line 100 of file KDChartPosition.h.
Referenced by KDChart::PositionPoints::point().
const Position & Position::Unknown = staticPositionUnknown [static] |
Definition at line 92 of file KDChartPosition.h.
Referenced by KDChart::RelativePosition::resetReferencePosition().
const Position & Position::West = staticPositionWest [static] |
Definition at line 101 of file KDChartPosition.h.
Referenced by KDChart::PositionPoints::point().