tuchulcha  0.10.1
Graphical Workflow Configuration Editor
InspectorDelegate.h
Go to the documentation of this file.
1 /* Copyright (C) 2009 Jens-Malte Gottfried
2 
3  This file is part of Tuchulcha.
4 
5  Tuchulcha is free software: you can redistribute it and/or modify
6  it under the terms of the GNU Lesser General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  Tuchulcha is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU Lesser General Public License for more details.
14 
15  You should have received a copy of the GNU Lesser General Public License
16  along with Tuchulcha. If not, see <http://www.gnu.org/licenses/>.
17 */
24 // The filename editor widgets are based on CMake code:
25 //
26 // Copyright (c) 2002 Kitware, Inc., Insight Consortium. All rights reserved.
27 //
28 // See CMakeCopyright.txt or
29 // http://www.cmake.org/HTML/Copyright.html for details.
30 //
31 // This software is distributed WITHOUT ANY WARRANTY; without even
32 // the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
33 // PURPOSE. See the above copyright notices for more information.
34 
35 #ifndef INSPECTORDELEGATE_H
36 #define INSPECTORDELEGATE_H
37 
38 #include <QStyledItemDelegate>
39 #include <QLineEdit>
40 #include <QCompleter>
41 class QToolButton;
42 
44 
56 class InspectorDelegate : public QStyledItemDelegate {
57  Q_OBJECT
58 public:
60 
63  InspectorDelegate(QObject* parent = 0);
64 
66 
74  virtual QWidget* createEditor(
75  QWidget* parent, const QStyleOptionViewItem& option,
76  const QModelIndex& index ) const;
77 
79 
86  bool eventFilter(QObject* object, QEvent* event);
87 
90 
94  virtual void setModelData (
95  QWidget* editor, QAbstractItemModel* model,
96  const QModelIndex & index ) const;
97 
98 protected slots:
100  void _setFileDialogFlag(bool flag);
102  void _handleCloseEditor(QWidget*,QAbstractItemDelegate::EndEditHint);
103 protected:
105  QString _workingDir;
108 };
109 
110 #endif // INSPECTORDELEGATE_H
void _handleCloseEditor(QWidget *, QAbstractItemDelegate::EndEditHint)
reset working dir
delegate to handle parameter types and offer specialized editors
bool eventFilter(QObject *object, QEvent *event)
filter editor events
InspectorDelegate(QObject *parent=0)
standart constructor
void _setFileDialogFlag(bool flag)
set _fileDialogFlag
QString _workingDir
cache
virtual void setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex &index) const
Sets the data for the item at the given index in the model to the contents of the given editor...
virtual QWidget * createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
create own editors, if necessary
bool _fileDialogFlag
file dialog opened