Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef RELATIVEPOSITIONS_H
00029 #define RELATIVEPOSITIONS_H
00030
00031 #include <QGpCoreTools.h>
00032 #include <QGpGuiTools.h>
00033 #include "ui_RelativePositions.h"
00034 #include "GeopsyGuiDLLExport.h"
00035
00036 namespace GeopsyGui {
00037
00038 class GEOPSYGUI_EXPORT RelativePositionsDelegate : public QItemDelegate
00039 {
00040 Q_OBJECT
00041 public:
00042 RelativePositionsDelegate(QObject *parent=0);
00043
00044 QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
00045 const QModelIndex &index) const;
00046 void setEditorData(QWidget *editor, const QModelIndex &index) const;
00047 void setModelData(QWidget *editor, QAbstractItemModel *model,
00048 const QModelIndex &index) const;
00049 void addStation(QString stationName) {_stationList << ("%1. "+ stationName).arg(_stationList.count()+1);}
00050 int indexOf(QString stationName) {return _stationList.indexOf(stationName);}
00051 QString stationAt(int i) {return _stationList.at(i);}
00052 private slots:
00053 inline void comboCommit();
00054 private:
00055 QStringList _stationList;
00056 };
00057
00058 inline void RelativePositionsDelegate::comboCommit()
00059 {
00060 TRACE;
00061 QComboBox * w=qobject_cast<QComboBox *>(sender());
00062 if(w) emit commitData (w);
00063 }
00064
00065 class GEOPSYGUI_EXPORT RelativePositions : public Dialog, public Ui::RelativePositions
00066 {
00067 Q_OBJECT
00068
00069 public:
00070 RelativePositions(QWidget* parent=0, Qt::WFlags fl=0);
00071 ~RelativePositions();
00072
00073 public slots:
00074 virtual void setStationList(const QList<NamedPoint> * stations);
00075 virtual void addBut_clicked();
00076 virtual void removeBut_clicked();
00077 virtual void updateCurrentDistAz(QTableWidgetItem * item);
00078 virtual void calculateAverage();
00079
00080 protected:
00081 const QList<NamedPoint> * _stations;
00082
00083 };
00084
00085 }
00086
00087 #endif // RELATIVEPOSITIONS_H