stable
v1.7.0
|
Last change
on this file was 85dd16, checked in by Frederik Heber <frederik.heber@…>, 7 weeks ago |
|
Adds new tab "All potentials".
|
-
Property mode
set to
100644
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | /*
|
|---|
| 2 | * QtPotentialList.hpp
|
|---|
| 3 | *
|
|---|
| 4 | * Created on: Aug 17, 2025
|
|---|
| 5 | * Author: heber
|
|---|
| 6 | */
|
|---|
| 7 |
|
|---|
| 8 | #ifndef QTPOTENTIALLIST_H_
|
|---|
| 9 | #define QTPOTENTIALLIST_H_
|
|---|
| 10 |
|
|---|
| 11 | // include config.h
|
|---|
| 12 | #ifdef HAVE_CONFIG_H
|
|---|
| 13 | #include <config.h>
|
|---|
| 14 | #endif
|
|---|
| 15 |
|
|---|
| 16 |
|
|---|
| 17 | #include <QtGui/QWidget>
|
|---|
| 18 | #include "CodePatterns/Observer/Observer.hpp"
|
|---|
| 19 |
|
|---|
| 20 | #include <boost/thread/recursive_mutex.hpp>
|
|---|
| 21 |
|
|---|
| 22 | class QTreeWidget;
|
|---|
| 23 |
|
|---|
| 24 | class QtPotentialList: public QWidget, public Observer
|
|---|
| 25 | {
|
|---|
| 26 | Q_OBJECT
|
|---|
| 27 |
|
|---|
| 28 | public:
|
|---|
| 29 | QtPotentialList(QWidget * _parent=0);
|
|---|
| 30 | virtual ~QtPotentialList();
|
|---|
| 31 |
|
|---|
| 32 | protected:
|
|---|
| 33 | virtual void update(Observable *publisher);
|
|---|
| 34 | virtual void subjectKilled(Observable *publisher);
|
|---|
| 35 | virtual void paintEvent(QPaintEvent * event);
|
|---|
| 36 |
|
|---|
| 37 | static const int COLUMNCOUNT;
|
|---|
| 38 | enum {NUMBER, NAME,CHARGES,PARAMETERS,COLUMNTYPES_MAX} COLUMNTYPES;
|
|---|
| 39 | static const char *COLUMNNAMES[];
|
|---|
| 40 |
|
|---|
| 41 | private slots:
|
|---|
| 42 | void refill();
|
|---|
| 43 |
|
|---|
| 44 | signals:
|
|---|
| 45 | void changed();
|
|---|
| 46 | void needsRefill();
|
|---|
| 47 |
|
|---|
| 48 | private:
|
|---|
| 49 | //!> flag to indicate that we got an update
|
|---|
| 50 | bool dirty;
|
|---|
| 51 | //!> flag to indicate whether we are subscribed to PotentialRegistry
|
|---|
| 52 | bool potentialregistry_enabled;
|
|---|
| 53 |
|
|---|
| 54 | mutable boost::recursive_mutex refill_mutex;
|
|---|
| 55 |
|
|---|
| 56 | private:
|
|---|
| 57 | QTreeWidget *treewidget;
|
|---|
| 58 | };
|
|---|
| 59 |
|
|---|
| 60 | #endif /* QTPOTENTIALLIST_H_ */
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.