contrib/parameter_gui/parameter_delegate.h

00001 //---------------------------------------------------------------------------
00002 //
00003 //    Copyright (C) 2010, 2011 by the deal.II authors
00004 //
00005 //    This file is subject to QPL and may not be  distributed
00006 //    without copyright and license information. Please refer
00007 //    to the file deal.II/doc/license.html for the  text  and
00008 //    further information on this license.
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 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

deal.II documentation generated on Wed May 23 2012 06:07:27 by doxygen 1.7.3