source:
src/UIElements/Views/Qt4/ElementList/QtElementList.hpp@
91c409
| Last change on this file since 91c409 was 3054f4a, checked in by , 10 years ago | |
|---|---|
|
|
| File size: 1.5 KB | |
| Rev | Line | |
|---|---|---|
| [0e6156] | 1 | /* |
| 2 | * QtElementList.h | |
| 3 | * | |
| 4 | * Created on: Mar 6, 2012 | |
| 5 | * Author: ankele | |
| 6 | */ | |
| 7 | ||
| 8 | #ifndef QTELEMENTLIST_H_ | |
| 9 | #define QTELEMENTLIST_H_ | |
| 10 | ||
| 11 | // include config.h | |
| 12 | #ifdef HAVE_CONFIG_H | |
| 13 | #include <config.h> | |
| 14 | #endif | |
| 15 | ||
| [f20fa5] | 16 | #include <QtGui/QTreeWidget> |
| [ea73ce] | 17 | |
| [bfd520c] | 18 | #include <boost/thread/recursive_mutex.hpp> |
| [0e6156] | 19 | |
| [a4dee7] | 20 | #include "types.hpp" |
| 21 | ||
| [5aec20] | 22 | #include "UIElements/Qt4/InstanceBoard/QtObservedAtom.hpp" |
| [bfd520c] | 23 | #include "UIElements/Views/Qt4/ElementList/QtObservedAtomObserver.hpp" |
| [5aec20] | 24 | |
| 25 | class QtObservedInstanceBoard; | |
| [0e6156] | 26 | |
| [bfd520c] | 27 | class QtElementList: public QTreeWidget |
| [0e6156] | 28 | { |
| 29 | Q_OBJECT | |
| 30 | ||
| 31 | public: | |
| [5aec20] | 32 | QtElementList(QtObservedInstanceBoard *_board, QWidget * _parent=0); |
| [0e6156] | 33 | virtual ~QtElementList(); |
| 34 | ||
| 35 | protected: | |
| [25b3559] | 36 | virtual void paintEvent(QPaintEvent * event); |
| [0e6156] | 37 | |
| [a4dee7] | 38 | void setOccurrence(QTreeWidgetItem &_item, const int count); |
| 39 | ||
| [0e6156] | 40 | static const int COLUMNCOUNT; |
| [fcdf05] | 41 | enum COLUMNTYPES {NUMBER,NAME,SYMBOL,MASS,OCCURRENCE,COLUMNTYPES_MAX}; |
| [0e6156] | 42 | static const char *COLUMNNAMES[]; |
| 43 | ||
| 44 | private slots: | |
| [1de61e] | 45 | void rowSelected(); |
| [bfd520c] | 46 | void changeElement(const QtObservedAtom::ptr _atom); |
| 47 | void addAtomElement(const QtObservedAtom::ptr _atom); | |
| [3054f4a] | 48 | void removeAtomElement(ObservedValue_Index_t _id); |
| [0e6156] | 49 | |
| 50 | private: | |
| [1de61e] | 51 | std::vector<bool> elementSelection; //!< needed to determine when a selection changes |
| [3054f4a] | 52 | typedef std::map<ObservedValue_Index_t, atomicNumber_t> AtomElementMap_t; |
| [a4dee7] | 53 | AtomElementMap_t AtomElementMap; |
| [818201] | 54 | bool dirty; |
| [ea73ce] | 55 | |
| [bfd520c] | 56 | //!> observed all QtObservedAtoms for ElementChanged signals |
| 57 | QtObservedAtomObserver atomobserver; | |
| [5aec20] | 58 | |
| [bfd520c] | 59 | mutable boost::recursive_mutex refill_mutex; |
| [0e6156] | 60 | }; |
| 61 | ||
| 62 | #endif /* QTELEMENTLIST_H_ */ |
Note:
See TracBrowser
for help on using the repository browser.
