Kstars

modcalcsimple.cpp
1#include "modcalcsimple.h"
2#include "widgets/dmsbox.h"
3
4#include <KLocalizedString>
5#include <KMessageBox>
6#include <QTextStream>
7#include <QFileDialog>
8
9modCalcSimple::modCalcSimple(QWidget *parentSplit) : QFrame(parentSplit)
10{
11 setupUi(this);
12
13 angle1Input->setUnits(dmsBox::HOURS);
14 angle2Input->setUnits(dmsBox::DEGREES);
15 connect(angle1Input, SIGNAL(editingFinished()), this, SLOT(slotCompute1()));
16 connect(angle2Input, SIGNAL(editingFinished()), this, SLOT(slotCompute2()));
17
18 show();
19}
20
21void modCalcSimple::slotCompute1()
22{
23 bool ok(false);
24 dms angle_new = angle1Input->createDms(&ok);
25 if (ok)
26 {
27 double angle_new_double = angle_new.Degrees();
28 angle1Result->setText(QString::number(angle_new_double, 'f', 11));
29 }
30}
31
32void modCalcSimple::slotCompute2()
33{
34 bool ok(false);
35 dms angle_new = angle2Input->createDms(&ok);
36 if (ok)
37 {
38 double angle_new_double = angle_new.Degrees();
39 angle2Result->setText(QString::number(angle_new_double, 'f', 11));
40 }
41}
An angle, stored as degrees, but expressible in many ways.
Definition dms.h:38
const double & Degrees() const
Definition dms.h:141
QString number(double n, char format, int precision)
QFuture< ArgsType< Signal > > connect(Sender *sender, Signal signal)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 4 2024 16:38:44 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.