Kstars

catalogcoloreditor.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 #ifndef CATALOGCOLOREDITOR_H
8 #define CATALOGCOLOREDITOR_H
9 
10 #include <QDialog>
11 #include "catalogsdb.h"
12 
13 namespace Ui
14 {
15 class CatalogColorEditor;
16 }
17 
18 /**
19  * A form for editing catalog color scheme mappings.
20  *
21  * If the constructor with the id is used, the dialog takes care of
22  * editing the database. Otherwise `CatalogColorEditor::colors` may be
23  * used.
24  */
26 {
27  Q_OBJECT
28  using color_map = CatalogsDB::CatalogColorMap;
29 
30  public:
31  explicit CatalogColorEditor(const int id, QWidget *parent = nullptr);
32  explicit CatalogColorEditor(color_map colors, QWidget *parent = nullptr);
33  explicit CatalogColorEditor(const QString &colors, QWidget *parent = nullptr);
34 
36 
37  color_map colors() { return m_colors; }
38  QString color_string() { return CatalogsDB::to_color_string(m_colors); };
39 
40  private:
41  Ui::CatalogColorEditor *ui;
42  color_map m_colors;
43  int m_id;
44 
45  void writeColors();
46  void init();
47  void make_color_button(const QString &name, const QColor &color);
48 };
49 
50 #endif // CATALOGCOLOREDITOR_H
Q_OBJECTQ_OBJECT
A form for editing catalog color scheme mappings.
QObject * parent() const const
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Fri Sep 22 2023 03:57:53 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.