Code_TYMPAN  4.4.0
Industrial site acoustic simulation
TYElementListItem.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) <2012> <EDF-R&D> <FRANCE>
3  * This program is free software; you can redistribute it and/or modify
4  * it under the terms of the GNU General Public License as published by
5  * the Free Software Foundation; either version 2 of the License, or
6  * (at your option) any later version.
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10  * See the GNU General Public License for more details.
11  * You should have received a copy of the GNU General Public License along
12  * with this program; if not, write to the Free Software Foundation, Inc.,
13  * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
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.