Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYElementListItem.h
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 
27 #ifndef __TY_ELEMENT_LIST_ITEM__
28 #define __TY_ELEMENT_LIST_ITEM__
29 
30 #include "TYAppDefines.h"
31 #include <qtreewidget.h>
32 
34 
39 class TYElementListItem : public QTreeWidgetItem
40 {
41 public:
46  TYElementListItem(QTreeWidget* parent, LPTYElement pElement, LPTYCalcul pCalcul = NULL,
47  const QStringList& labels = QStringList(), bool checkable = false);
52  TYElementListItem(QTreeWidgetItem* parent, LPTYElement pElement, LPTYCalcul pCalcul = NULL,
53  const QStringList& labels = QStringList(), bool checkable = false);
58  TYElementListItem(QTreeWidget* parent, const QStringList& labels, LPTYCalcul pCalcul = NULL,
59  bool checkable = false);
64  TYElementListItem(QTreeWidgetItem* parent, const QStringList& labels, LPTYCalcul pCalcul = NULL,
65  bool checkable = false);
66 
71  virtual ~TYElementListItem();
72 
78  {
79  return _pElement;
80  }
81 
86  void updateContent();
87 
93  {
94  return _elementItem;
95  }
96 
101  void remove();
102 
107  bool isCheckable()
108  {
109  return _checkable;
110  }
111 
116  void setOn(bool state, bool UpdateModelers);
117 
122  void setCheckState(int column, Qt::CheckState state);
123 
124 private:
129  void updateChilds();
130 
131 protected:
132  void initItem(LPTYElement pElement, LPTYCalcul pCalcul, const QStringList& labels = QStringList(),
133  bool checkable = false);
134 
135 protected:
138 
141 
144 
147 };
148 
149 #endif //__TY_ELEMENT_LIST_ITEM__
Frame pour les messages de retour.
bool isElementItem()
Indique si un element est associe a cet item.
void updateContent()
Mets a jour le contenu des colonnes.
void initItem(LPTYElement pElement, LPTYCalcul pCalcul, const QStringList &labels=QStringList(), bool checkable=false)
bool isCheckable()
Indique si de type checkbox.
void updateChilds()
update child status
void setOn(bool state, bool UpdateModelers)
ajouter a la liste
TYElementListItem(QTreeWidget *parent, LPTYElement pElement, LPTYCalcul pCalcul=NULL, const QStringList &labels=QStringList(), bool checkable=false)
Constructeur.
LPTYElement _pElement
L'element associe a cet item.
virtual ~TYElementListItem()
Destructeur.
LPTYElement getElement()
Retourne l'element associe a cet item.
void remove()
Supprime l'item de la liste.
bool _checkable
element de type checkbox ?
void setCheckState(int column, Qt::CheckState state)
Reimplementation.
bool _elementItem
Indique si un element est associe a cet item.
LPTYCalcul _pCurrentCalcul
Le Calcul courant.