Kstars

flagmanager.h
1 /*
2  SPDX-FileCopyrightText: 2009 Jerome SONRIER <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include "ui_flagmanager.h"
10 
11 #include <QAbstractTableModel>
12 #include <QDialog>
13 
15 class QStandardItemModel;
16 class KStars;
17 
18 class FlagManagerUI : public QFrame, public Ui::FlagManager
19 {
20  Q_OBJECT
21 
22  public:
23  /** @short Constructor */
24  explicit FlagManagerUI(QWidget *parent);
25 };
26 
27 /**
28  * @class FlagManager
29  * @short Flag manager
30  * Dialog box to add and remove flags
31  *
32  * @version 1.1
33  * @author Jerome SONRIER
34  */
35 class FlagManager : public QDialog
36 {
37  Q_OBJECT
38  public:
39  explicit FlagManager(QWidget *ks);
40 
41  virtual ~FlagManager() override = default;
42 
43  void setRaDec(const dms &ra, const dms &dec);
44  void clearFields();
45  void showFlag(const int flagIdx);
46 
47  bool validatePoint();
48 
49  void deleteFlagItem(int flagIdx);
50 
51  public slots:
52  /** @short Verify coordinates and add a flag */
53  void slotAddFlag();
54 
55  /** @short Delete a flag */
56  void slotDeleteFlag();
57 
58  /** @short Center the selected flag in the display */
59  void slotCenterFlag();
60 
61  /** @brief Center the selected flag in the telescope. */
62  void slotCenterTelescope();
63 
64  private slots:
65  void slotSaveChanges();
66  void slotSetShownFlag(QModelIndex idx);
67 
68  private:
69  void insertFlag(bool isNew, int row = 0);
70 
71  KStars *m_Ks { nullptr };
72  FlagManagerUI *ui { nullptr };
73  QStandardItemModel *m_Model { nullptr };
74  QSortFilterProxyModel *m_SortModel { nullptr };
75 };
Q_OBJECTQ_OBJECT
void slotDeleteFlag()
Delete a flag.
void slotAddFlag()
Verify coordinates and add a flag.
Flag manager Dialog box to add and remove flags.
Definition: flagmanager.h:35
void slotCenterFlag()
Center the selected flag in the display.
This is the main window for KStars. In addition to the GUI elements, the class contains the program c...
Definition: kstars.h:92
void slotCenterTelescope()
Center the selected flag in the telescope.
An angle, stored as degrees, but expressible in many ways.
Definition: dms.h:37
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:54 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.