Kstars

catalogeditform.h
1 /*
2  SPDX-FileCopyrightText: 2021 Valentin Boettcher <hiro at protagon.space; @hiro98:tchncs.de>
3 
4  SPDX-License-Identifier: GPL-2.0-or-later
5 */
6 
7 #pragma once
8 
9 #include <QDialog>
10 #include "catalogsdb.h"
11 
12 namespace Ui
13 {
14 class CatalogEditForm;
15 }
16 
17 /**
18  * A simple data entry form for creating/editing catalog meta
19  * information.
20  *
21  * As this is intended to be used for custom catalogs only, the
22  * minimum for the catalog `id` is set to
23  * `CatalogsDB::custom_cat_min_id`.
24  */
25 class CatalogEditForm : public QDialog
26 {
27  Q_OBJECT
28 
29  public:
30  explicit CatalogEditForm(QWidget *parent, const CatalogsDB::Catalog &catalog,
31  const int min_id = CatalogsDB::custom_cat_min_id,
32  const bool allow_id_edit = true);
33  ~CatalogEditForm();
34 
35  /**
36  * Get the result of the catalog edit.
37  */
38  CatalogsDB::Catalog getCatalog() { return m_catalog; };
39 
40  private:
41  Ui::CatalogEditForm *ui;
42  CatalogsDB::Catalog m_catalog;
43 
44  /**
45  * Fills the form fields with the given catalog information.
46  */
47  void fill_form_from_catalog();
48 };
Q_OBJECTQ_OBJECT
A simple data entry form for creating/editing catalog meta information.
CatalogsDB::Catalog getCatalog()
Get the result of the catalog edit.
A simple struct to hold information about catalogs.
Definition: catalogsdb.h:35
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Fri Aug 12 2022 04:00:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.