QAdvanced Item View  0.4
The QAIV (Qt Advanced Item Views) library provides GUI and utility classes extending the capabilities of the Qt item views.
 All Classes Functions Variables Enumerations Enumerator Properties Groups Pages
qfilterviewitemdelegate.h
1 /******************************************************************************
2 ** This file is part of qadvanceditemviews.
3 **
4 ** Copyright (c) 2011-2012 Martin Hoppe martin@2x2hoppe.de
5 **
6 ** qadvanceditemviews is free software: you can redistribute it
7 ** and/or modify it under the terms of the GNU Lesser General
8 ** Public License as published by the Free Software Foundation,
9 ** either version 3 of the License, or (at your option) any
10 ** later version.
11 **
12 ** qadvanceditemviews is distributed in the hope that it will be
13 ** useful, but WITHOUT ANY WARRANTY; without even the implied
14 ** warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15 ** See the GNU General Public License for more details.
16 **
17 ** You should have received a copy of the GNU Lesser General Public
18 ** License along with qadvanceditemviews.
19 ** If not, see <http://www.gnu.org/licenses/>.
20 ******************************************************************************/
21 #ifndef QFILTERVIEWITEMDELEGATE_H
22 #define QFILTERVIEWITEMDELEGATE_H
23 
24 #include <QListWidgetItem>
25 #include <QStyledItemDelegate>
26 
27 #include <qaivlib_global.h>
28 
30 class QAIVLIBSHARED_EXPORT QFilterViewItemDelegate : public QStyledItemDelegate
31 {
32  Q_OBJECT
33 public:
37  QFilterViewItemDelegate(QObject* parent);
46  QWidget* createEditor( QWidget * parent, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
47 
48  void setEditorData( QWidget * editor, const QModelIndex & index ) const;
49 
50  void setModelData( QWidget * editor, QAbstractItemModel * model, const QModelIndex & index ) const;
51 
52  QSize sizeHint( const QStyleOptionViewItem & option, const QModelIndex & index ) const;
56  void updateEditorGeometry( QWidget* editor, const QStyleOptionViewItem & option, const QModelIndex & index ) const;
57 public slots:
58  void commitAndClose(QAbstractItemDelegate::EndEditHint hint = QAbstractItemDelegate::NoHint);
59  void cancelAndClose(QAbstractItemDelegate::EndEditHint hint = QAbstractItemDelegate::NoHint);
60 private slots:
61  void comboxBoxItemActivated( int index );
62 
63  void listWidgetCurrentItemChanged( QListWidgetItem* current, QListWidgetItem* previous );
64 
65  void lineEditReturnPressed();
66 private:
67  bool m_enableFilter;
68 };
69 
70 #endif // QFILTERVIEWITEMDELEGATE_H
The QFilterViewItemDelegate class provides display and editing facilities for filter from a filter mo...
Definition: qfilterviewitemdelegate.h:30