00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef PARAMETERDELEGATE_H
00013 #define PARAMETERDELEGATE_H
00014
00015 #include <QItemDelegate>
00016 #include <QModelIndex>
00017 #include <QObject>
00018 #include <QLineEdit>
00019 #include <QComboBox>
00020 #include <QFileDialog>
00021
00022 #include "browse_lineedit.h"
00023
00024
00025 namespace dealii
00026 {
00030 namespace ParameterGui
00031 {
00048 class ParameterDelegate : public QItemDelegate
00049 {
00050 Q_OBJECT
00051
00052 public:
00057 ParameterDelegate (const int value_column, QObject *parent = 0);
00062 QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option,
00063 const QModelIndex &index) const;
00067 QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
00071 void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
00075 void setEditorData(QWidget *editor, const QModelIndex &index) const;
00079 void setModelData(QWidget *editor, QAbstractItemModel *model,
00080 const QModelIndex &index) const;
00081
00082 private slots:
00086 void commit_and_close_editor();
00087
00088 private:
00092 int value_column;
00098 double double_steps;
00104 unsigned int int_steps;
00110 unsigned int double_decimals;
00111 };
00112 }
00114 }
00115
00116
00117 #endif
00118