/* * QtMoleculeList.hpp * * Created on: Jan 21, 2010 * Author: crueger */ #ifndef QTMOLECULELIST_HPP_ #define QTMOLECULELIST_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include "CodePatterns/Observer/Observer.hpp" #include "types.hpp" class molecule; class MoleculeListClass; class QtMoleculeList : public QTreeWidget, public Observer { Q_OBJECT public: QtMoleculeList(QWidget * _parent=0); virtual ~QtMoleculeList(); protected: virtual void update(Observable *publisher); virtual void subjectKilled(Observable *publisher); virtual void paintEvent(QPaintEvent * event); void refill(); static const int COLUMNCOUNT; enum {NAME,VISIBILITY,ATOMCOUNT,FORMULA,OCCURRENCE,COLUMNTYPES_MAX} COLUMNTYPES; static const char *COLUMNNAMES[]; private slots: void moleculeChanged(); void visibilityChanged(QTreeWidgetItem*, int); void rowsSelected(const QItemSelection & selected, const QItemSelection & deselected); signals: void moleculeSelected(molecule*); void moleculeUnSelected(molecule*); void moleculesVisibilityChanged(const moleculeId_t, bool); private: bool dirty; bool clearing; bool selecting; }; #endif /* QTMOLECULELIST_HPP_ */