/* * QtWorldView.hpp * * Created on: Jan 21, 2010 * Author: crueger */ #ifndef QTMOLECULESVIEW_HPP_ #define QTMOLECULESVIEW_HPP_ #include #include "Patterns/Observer.hpp" class molecule; class MoleculeListClass; class QtWorldView : public QTableWidget, public Observer { Q_OBJECT public: QtWorldView(QWidget * _parent=0); virtual ~QtWorldView(); protected: virtual void update(Observable *publisher); virtual void subjectKilled(Observable *publisher); static const int COLUMNCOUNT; enum {NAME,ATOMS,FORMULA,COLUMNTYPES_MAX} COLUMNTYPES; static const char *COLUMNNAMES[]; private slots: void moleculeChanged(int row, int column); void cellSelected(int row, int column); signals: void moleculeSelected(molecule*); void moleculeUnSelected(molecule*); private: std::vector molSelection; //!< needed to determine when a selection changes MoleculeListClass *molecules; }; #endif /* QTMOLECULESVIEW_HPP_ */