OpenFCST: The open-source Fuel Cell Simulation Toolbox
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
parameter_delegate.h
Go to the documentation of this file.
1 // ---------------------------------------------------------------------
2 // $Id: parameter_delegate.h 2226 2014-04-04 21:21:00Z secanell $
3 //
4 // Copyright (C) 2010 - 2013 by Martin Steigemann and Wolfgang Bangerth
5 //
6 // This file is part of the deal.II library.
7 //
8 // The deal.II library is free software; you can use it, redistribute
9 // it, and/or modify it under the terms of the GNU Lesser General
10 // Public License as published by the Free Software Foundation; either
11 // version 2.1 of the License, or (at your option) any later version.
12 // The full text of the license can be found in the file LICENSE at
13 // the top level of the deal.II distribution.
14 //
15 // ---------------------------------------------------------------------
16 
17 
18 #ifndef PARAMETERDELEGATE_H
19 #define PARAMETERDELEGATE_H
20 
21 #include <QItemDelegate>
22 #include <QModelIndex>
23 #include <QObject>
24 #include <QLineEdit>
25 #include <QComboBox>
26 #include <QFileDialog>
27 
28 #include "browse_lineedit.h"
29 
30 
31 namespace dealii
32 {
36  namespace ParameterGui
37  {
54  class ParameterDelegate : public QItemDelegate
55  {
56  Q_OBJECT
57 
58  public:
63  ParameterDelegate (const int value_column, QObject *parent = 0);
68  QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option,
69  const QModelIndex &index) const;
73  QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const;
77  void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const;
81  void setEditorData(QWidget *editor, const QModelIndex &index) const;
85  void setModelData(QWidget *editor, QAbstractItemModel *model,
86  const QModelIndex &index) const;
87 
88  private slots:
93 
94  private:
104  double double_steps;
110  unsigned int int_steps;
116  unsigned int double_decimals;
117  };
118  }
120 }
121 
122 
123 #endif
double double_steps
For parameters of type double a spin box will be shown as editor.
Definition: parameter_delegate.h:104
QSize sizeHint(const QStyleOptionViewItem &option, const QModelIndex &index) const
Reimplemented from QItemDelegate.
ParameterDelegate(const int value_column, QObject *parent=0)
Constructor, value_column specifies the column of the parameter tree this delegate will be used on...
unsigned int int_steps
For parameters of type integer a spin box will be shown as editor.
Definition: parameter_delegate.h:110
The ParameterDelegate class implements special delegates for the QTreeWidget class used in the parame...
Definition: parameter_delegate.h:54
QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
This function creates the appropriate editor for the parameter based on the index.
void commit_and_close_editor()
Reimplemented from QItemDelegate.
void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const
Reimplemented from QItemDelegate.
void setEditorData(QWidget *editor, const QModelIndex &index) const
Reimplemented from QItemDelegate.
void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Reimplemented from QItemDelegate.
int value_column
The column this delegate will be used on.
Definition: parameter_delegate.h:98
unsigned int double_decimals
For parameters of type double a spin box will be shown as editor.
Definition: parameter_delegate.h:116