OGS
SelectMeshDialog Class Reference

Detailed Description

Small dialog for setting a name for an object.

Definition at line 31 of file SelectMeshDialog.h.

#include <SelectMeshDialog.h>

Inheritance diagram for SelectMeshDialog:
[legend]
Collaboration diagram for SelectMeshDialog:
[legend]

Public Member Functions

 SelectMeshDialog (const GeoLib::GeoObject *geo_object, const std::list< std::string > &msh_names, QDialog *parent=nullptr)
 Constructor.
 
 ~SelectMeshDialog () override
 

Public Attributes

QDialogButtonBox * _buttonBox
 

Private Slots

void accept () override
 Instructions if the OK-Button has been pressed.
 
void reject () override
 Instructions if the Cancel-Button has been pressed.
 

Private Member Functions

void setupDialog (const std::list< std::string > &msh_names)
 The buttons used in this dialog.
 

Private Attributes

QLabel * _txt_label
 
QComboBox * _msh_names
 
QVBoxLayout * _layout
 
const GeoLib::GeoObject_geo_object
 

Constructor & Destructor Documentation

◆ SelectMeshDialog()

SelectMeshDialog::SelectMeshDialog ( const GeoLib::GeoObject * geo_object,
const std::list< std::string > & msh_names,
QDialog * parent = nullptr )

Constructor.

Definition at line 24 of file SelectMeshDialog.cpp.

27 : QDialog(parent), _geo_object(geo_object)
28{
29 setupDialog(msh_names);
30 show();
31}
void setupDialog(const std::list< std::string > &msh_names)
The buttons used in this dialog.
const GeoLib::GeoObject * _geo_object

References setupDialog().

◆ ~SelectMeshDialog()

SelectMeshDialog::~SelectMeshDialog ( )
override

Definition at line 33 of file SelectMeshDialog.cpp.

34{
35 delete _buttonBox;
36 delete _layout;
37 delete _msh_names;
38 delete _txt_label;
39}
QDialogButtonBox * _buttonBox
QComboBox * _msh_names
QVBoxLayout * _layout

References _buttonBox, _layout, _msh_names, and _txt_label.

Member Function Documentation

◆ accept

void SelectMeshDialog::accept ( )
overrideprivateslot

Instructions if the OK-Button has been pressed.

Definition at line 66 of file SelectMeshDialog.cpp.

67{
68 // emit requestNameChange(_parent_name,
69 // GeoLib::convertGeoType(_object_type_name), _id,
70 // _new_name->text().toStdString());
71 this->done(QDialog::Accepted);
72}

Referenced by setupDialog().

◆ reject

void SelectMeshDialog::reject ( )
overrideprivateslot

Instructions if the Cancel-Button has been pressed.

Definition at line 74 of file SelectMeshDialog.cpp.

75{
76 this->done(QDialog::Rejected);
77}

Referenced by setupDialog().

◆ setupDialog()

void SelectMeshDialog::setupDialog ( const std::list< std::string > & msh_names)
private

The buttons used in this dialog.

Constructs a dialog window

Definition at line 41 of file SelectMeshDialog.cpp.

42{
43 _layout = new QVBoxLayout(this);
44 QString dialog_text("Select Mesh");
45 _txt_label = new QLabel(this);
46 _txt_label->setText(dialog_text);
47
48 _msh_names = new QComboBox();
49 for (const auto& msh_name : msh_names)
50 {
51 _msh_names->addItem(QString::fromStdString(msh_name));
52 }
53
54 setWindowTitle("Select Mesh...");
55 _layout->addWidget(_txt_label);
56 _layout->addWidget(_msh_names);
58 new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
59 connect(_buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
60 connect(_buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
61 _layout->addWidget(_buttonBox);
62
63 setLayout(_layout);
64}
void accept() override
Instructions if the OK-Button has been pressed.
void reject() override
Instructions if the Cancel-Button has been pressed.

References _buttonBox, _layout, _msh_names, _txt_label, accept(), and reject().

Referenced by SelectMeshDialog().

Member Data Documentation

◆ _buttonBox

QDialogButtonBox* SelectMeshDialog::_buttonBox

Definition at line 42 of file SelectMeshDialog.h.

Referenced by ~SelectMeshDialog(), and setupDialog().

◆ _geo_object

const GeoLib::GeoObject* SelectMeshDialog::_geo_object
private

Definition at line 51 of file SelectMeshDialog.h.

◆ _layout

QVBoxLayout* SelectMeshDialog::_layout
private

Definition at line 50 of file SelectMeshDialog.h.

Referenced by ~SelectMeshDialog(), and setupDialog().

◆ _msh_names

QComboBox* SelectMeshDialog::_msh_names
private

Definition at line 49 of file SelectMeshDialog.h.

Referenced by ~SelectMeshDialog(), and setupDialog().

◆ _txt_label

QLabel* SelectMeshDialog::_txt_label
private

Definition at line 48 of file SelectMeshDialog.h.

Referenced by ~SelectMeshDialog(), and setupDialog().


The documentation for this class was generated from the following files: