/* * QtHomologyList.hpp * * Created on: Jun 24, 2013 * Author: heber */ #ifndef QTHOMOLOGYLIST_H_ #define QTHOMOLOGYLIST_H_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include "CodePatterns/Observer/Observer.hpp" class HomologyGraph; class QSeisPlotPage; class QTreeWidget; class QtHomologyList: public QWidget, public Observer { Q_OBJECT public: QtHomologyList(QWidget * _parent=0); virtual ~QtHomologyList(); protected: virtual void update(Observable *publisher); virtual void subjectKilled(Observable *publisher); virtual void paintEvent(QPaintEvent * event); static const int COLUMNCOUNT; enum {NUMBER,NODES,EDGES,OCCURRENCE,COLUMNTYPES_MAX} COLUMNTYPES; static const char *COLUMNNAMES[]; private slots: void rowSelected(); void refill(); signals: void HomologySelected(HomologyGraph const *); void HomologyUnSelected(HomologyGraph const *); void changed(); void needsRefill(); private: std::vector HomologySelection; //!< needed to determine when a selection changes //!> flag to indicate that we got an update bool dirty; //!> flag to indicate that we currently clear the view, avoids thread collisions bool clearing; //!> flag to indicate whether we are subscribed to PotentialRegistry bool potentialregistry_enabled; private: QTreeWidget *treewidget; #ifdef HAVE_QWT QSeisPlotPage *widget; #else QWidget *widget; #endif }; #endif /* QTHOMOLOGYLIST_H_ */