11#include <QRegularExpression>
13#include <KLocalizedString>
26void dmsBox::setPlaceholderText()
28 if (m_unit == DEGREES)
37 const bool t = (m_unit == Unit::DEGREES);
39 QString sTip = (t ?
i18n(
"Angle value in degrees.") :
i18n(
"Angle value in hours."));
46 sWhatsThis =
i18n(
"This box displays an angle in degrees. "
47 "The three numbers displayed are the angle's "
48 "degrees, arcminutes, and arcseconds.");
52 sWhatsThis =
i18n(
"This box displays an angle in hours. "
53 "The three numbers displayed are the angle's "
54 "hours, minutes, and seconds.");
61 sTip +=
i18n(
" You may enter a simple integer, or a floating-point value, "
62 "or space- or colon-delimited values specifying "
63 "degrees, arcminutes and arcseconds");
65 sWhatsThis =
i18n(
"Enter an angle value in degrees. The angle can be expressed "
66 "as a simple integer (\"12\"), a floating-point value "
67 "(\"12.33\"), or as space- or colon-delimited "
68 "values specifying degrees, arcminutes and arcseconds (\"12:20\", \"12:20:00\", "
69 "\"12 20\", \"12 20 00.0\", etc.).");
73 sTip +=
i18n(
" You may enter a simple integer, or a floating-point value, "
74 "or space- or colon-delimited values specifying "
75 "hours, minutes and seconds");
77 sWhatsThis =
i18n(
"Enter an angle value in hours. The angle can be expressed "
78 "as a simple integer (\"12\"), a floating-point value "
79 "(\"12.33\"), or as space- or colon-delimited "
80 "values specifying hours, minutes and seconds (\"12:20\", \"12:20:00\", "
81 "\"12 20\", \"12 20 00.0\", etc.).");
94 if (m_unit == Unit::DEGREES)
96 double seconds = d.arcsec() + d.marcsec() / 1000.;
99 else if (m_unit == Unit::HOURS)
101 double seconds = d.second() + d.msecond() / 1000.;
dmsBox(QWidget *parent, Unit unit)
Constructor for the dmsBox object.
void setUnits(Unit unit)
set the dmsBox to Degrees or Hours
dms createDms(bool *ok=nullptr)
Parse the text in the dmsBox as an angle.
An angle, stored as degrees, but expressible in many ways.
virtual bool setFromString(const QString &s, bool isDeg=true)
Attempt to parse the string argument as a dms value, and set the dms object accordingly.
QString i18n(const char *text, const TYPE &arg...)
void setPlaceholderText(const QString &)
bool isReadOnly() const const
void setText(const QString &)
QString asprintf(const char *cformat,...)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:16:42 by
doxygen 1.12.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.