Kstars

focusdialog.h
1 /*
2  SPDX-FileCopyrightText: 2002 Jason Harris <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "ui_focusdialog.h"
10 
11 #include <QDialog>
12 
13 class QPushButton;
14 
15 class SkyPoint;
16 
17 class FocusDialogUI : public QFrame, public Ui::FocusDialog
18 {
19  Q_OBJECT
20 
21  public:
22  explicit FocusDialogUI(QWidget *parent = nullptr);
23 };
24 
25 /**
26  * @class FocusDialog
27  * @short A small dialog for setting the focus coordinates manually.
28  *
29  * @author Jason Harris
30  * @version 1.0
31  */
32 class FocusDialog : public QDialog
33 {
34  Q_OBJECT
35 
36  public:
37  /** Constructor. */
38  FocusDialog();
39 
40  /** @return pointer to the SkyPoint described by the entered RA, Dec */
41  inline SkyPoint *point()
42  {
43  return Point;
44  }
45 
46  /** @return suggested size of focus window. */
47  QSize sizeHint() const override;
48 
49  /** @return whether user set the AltAz coords */
50  inline bool usedAltAz() const
51  {
52  return UsedAltAz;
53  }
54 
55  /** Show the Az/Alt page instead of the RA/Dec page. */
56  void activateAzAltPage() const;
57 
58  public slots:
59  /** If text has been entered in both KLineEdits, enable the Ok button. */
60  void checkLineEdits();
61 
62  /**
63  * Attempt to interpret the text in the KLineEdits as Ra and Dec values.
64  * If the point is validated, close the window.
65  */
66  void validatePoint();
67 
68  private:
69  SkyPoint *Point { nullptr };
70  FocusDialogUI *fd { nullptr };
71  bool UsedAltAz { false };
72  QPushButton *okB { nullptr };
73 };
Q_OBJECTQ_OBJECT
Stores dms coordinates for a point in the sky. for converting between coordinate systems.
Definition: skypoint.h:44
void validatePoint()
Attempt to interpret the text in the KLineEdits as Ra and Dec values.
void activateAzAltPage() const
Show the Az/Alt page instead of the RA/Dec page.
QSize sizeHint() const override
bool usedAltAz() const
Definition: focusdialog.h:50
SkyPoint * point()
Definition: focusdialog.h:41
A small dialog for setting the focus coordinates manually.
Definition: focusdialog.h:32
FocusDialog()
Constructor.
Definition: focusdialog.cpp:28
void checkLineEdits()
If text has been entered in both KLineEdits, enable the Ok button.
Definition: focusdialog.cpp:98
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Sat Aug 13 2022 04:01:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.