Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYDalleWidget.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012-2024> <EDF-DTG> <FRANCE>
3  * This file is part of Code_TYMPAN (R).
4  * Code_TYMPAN (R) is free software: you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation, either version 3 of the License, or
7  * (at your option) any later version.
8  * Code_TYMPAN (R) is distributed in the hope that it will be useful,
9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
11  * See the GNU General Public License for more details.
12  * You should have received a copy of the GNU General Public License along
13  * with Code_TYMPAN (R). If not, see <https://www.gnu.org/licenses/>.
14  */
15 
21 #include <QCheckBox>
22 // Added by qt3to4:
23 #include <QGridLayout>
24 #include <QLabel>
25 #include <QtWidgets>
26 
30 #include "TYDalleWidget.h"
31 
32 #define TR(id) OLocalizator::getString("TYDalleWidget", (id))
33 
34 TYDalleWidget::TYDalleWidget(TYDalle* pElement, QWidget* _pParent /*=NULL*/) : TYWidget(pElement, _pParent)
35 {
36 
37  _accPolygonW = new TYAcousticPolygonWidget(pElement, this);
39  // _accPolygonW->setLayoutSpacing(0, 0);
40 
41  resize(300, 680);
42  setWindowTitle(TR("id_caption"));
43  _dalleLayout = new QGridLayout();
44  setLayout(_dalleLayout);
45 
46  _dalleLayout->addWidget(_accPolygonW, 1, 0);
47 
48  _groupBoxParoi = new QGroupBox(this);
49  _groupBoxParoi->setTitle(TR("id_paroi"));
50  _groupBoxParoiLayout = new QGridLayout();
52 
53  _lineEditNomParoi = new QLineEdit(_groupBoxParoi);
54  _lineEditNomParoi->setEnabled(false);
55  _groupBoxParoiLayout->addWidget(_lineEditNomParoi, 0, 0);
56 
57  _pushButtonParoi = new QPushButton(_groupBoxParoi);
58  _pushButtonParoi->setText(TR("id_proprietes_button"));
59  _groupBoxParoiLayout->addWidget(_pushButtonParoi, 0, 1);
60 
61  _labeUseEtage = new QLabel(_groupBoxParoi);
62  _labeUseEtage->setText(TR("id_useEtage_label"));
63  _checkBoxUseEtage = new QCheckBox(_groupBoxParoi);
64  _checkBoxUseEtage->setText(TR(""));
65  _groupBoxParoiLayout->addWidget(_labeUseEtage, 1, 0);
66  _groupBoxParoiLayout->addWidget(_checkBoxUseEtage, 1, 1);
67 
68  _dalleLayout->addWidget(_groupBoxParoi, 3, 0);
69 
70  connect(_pushButtonParoi, &QPushButton::clicked, this, &TYDalleWidget::editParoi);
71  connect(_checkBoxUseEtage, &QPushButton::clicked, this, &TYDalleWidget::updateUseParoi);
72 
73  updateContent();
74 }
75 
77 
79 {
81 
82  _lineEditNomParoi->setText(getElement()->getParoi()->getName());
83  _checkBoxUseEtage->setChecked(!(getElement()->isParoiLocked()));
84 
86 }
87 
89 {
91  getElement()->setParoiLocked(!(_checkBoxUseEtage->isChecked()));
92 
93  emit modified();
94 }
95 
97 {
98  int ret = getElement()->getParoi()->edit(this);
99 
100  if (ret == QDialog::Accepted)
101  {
102  _lineEditNomParoi->setText(getElement()->getParoi()->getName());
103  }
104 }
105 
107 {
108  _pushButtonParoi->setEnabled(!(_checkBoxUseEtage->isChecked()));
109 }
objet IHM pour un polygone acoustique (fichier header)
#define TR(id)
Outil IHM pour une dalle (fichier header)
classe de l'objet IHM pour un polygone acoustique
QCheckBox * _checkBoxUseEtage
Definition: TYDalleWidget.h:87
QLabel * _labeUseEtage
Definition: TYDalleWidget.h:86
QGridLayout * _dalleLayout
Definition: TYDalleWidget.h:83
virtual void apply()
virtual ~TYDalleWidget()
TYDalleWidget(TYDalle *pElement, QWidget *_pParent=NULL)
QGridLayout * _groupBoxParoiLayout
Definition: TYDalleWidget.h:84
TYAcousticPolygonWidget * _accPolygonW
Definition: TYDalleWidget.h:89
QPushButton * _pushButtonParoi
Definition: TYDalleWidget.h:81
QGroupBox * _groupBoxParoi
Definition: TYDalleWidget.h:79
QLineEdit * _lineEditNomParoi
Definition: TYDalleWidget.h:80
virtual void updateContent()
classe de l'objet IHM pour un objet metier de type TYElement
Definition: TYWidget.h:43
void modified()