OGS
SetNameDialog.h
Go to the documentation of this file.
1 
15 #pragma once
16 
17 #include <QDialog>
18 #include "GeoLib/GeoType.h"
19 
20 class QDialogButtonBox;
21 class QLabel;
22 class QLineEdit;
23 class QVBoxLayout;
24 
28 class SetNameDialog : public QDialog
29 {
30  Q_OBJECT
31 
32 public:
34  SetNameDialog(const std::string& geo_object_type, std::size_t id,
35  const std::string& old_name, QDialog* parent = nullptr);
36  ~SetNameDialog() override;
37 
38  std::string getNewName();
39 
40 private:
42  void setupDialog(const QString &label, const std::string &old_name);
43 
44  QLabel* _txt_label;
45  QLineEdit* _new_name;
46  QVBoxLayout* _layout;
47  QDialogButtonBox* _buttonBox;
48 
49 private slots:
51  void accept() override;
52 
54  void reject() override;
55 };
Definition of the GEOTYPE enumeration.
Small dialog for setting a name for an object.
Definition: SetNameDialog.h:29
void setupDialog(const QString &label, const std::string &old_name)
Constructs a dialog window.
QDialogButtonBox * _buttonBox
Definition: SetNameDialog.h:47
QLineEdit * _new_name
Definition: SetNameDialog.h:45
std::string getNewName()
QLabel * _txt_label
Definition: SetNameDialog.h:44
void reject() override
Instructions if the Cancel-Button has been pressed.
~SetNameDialog() override
void accept() override
Instructions if the OK-Button has been pressed.
SetNameDialog(const std::string &geo_object_type, std::size_t id, const std::string &old_name, QDialog *parent=nullptr)
Constructor.
QVBoxLayout * _layout
Definition: SetNameDialog.h:46