OGS
SetNameDialog.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#pragma once
5
6#include <QDialog>
7#include "GeoLib/GeoType.h"
8
9class QDialogButtonBox;
10class QLabel;
11class QLineEdit;
12class QVBoxLayout;
13
17class SetNameDialog : public QDialog
18{
19 Q_OBJECT
20
21public:
23 SetNameDialog(const std::string& geo_object_type, std::size_t id,
24 const std::string& old_name, QDialog* parent = nullptr);
25 ~SetNameDialog() override;
26
27 std::string getNewName();
28
29private:
31 void setupDialog(const QString &label, const std::string &old_name);
32
33 QLabel* _txt_label;
34 QLineEdit* _new_name;
35 QVBoxLayout* _layout;
36 QDialogButtonBox* _buttonBox;
37
38private slots:
40 void accept() override;
41
43 void reject() override;
44};
void setupDialog(const QString &label, const std::string &old_name)
Constructs a dialog window.
QDialogButtonBox * _buttonBox
QLineEdit * _new_name
std::string getNewName()
QLabel * _txt_label
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