File indexing completed on 2024-05-12 16:41:07

0001 /***************************************************************************
0002     begin                : Sunday Jun 27 2008
0003     copyright            : (C) 2008 by Mathias Soeken
0004     email                : msoeken@informatik.uni-bremen.de
0005  ***************************************************************************/
0006 
0007 /***************************************************************************
0008  *                                                                         *
0009  *   This program is free software; you can redistribute it and/or modify  *
0010  *   it under the terms of the GNU General Public License as published by  *
0011  *   the Free Software Foundation; either version 2 of the License, or     *
0012  *   (at your option) any later version.                                   *
0013  *                                                                         *
0014  ***************************************************************************/
0015 
0016 #ifndef TABULARCELLDELEGATE_H
0017 #define TABULARCELLDELEGATE_H
0018 
0019 #include <QStyledItemDelegate>
0020 
0021 class QAbstractItemModel;
0022 class QModelIndex;
0023 class QPainter;
0024 class QStyleOptionViewItem;
0025 class QTableWidget;
0026 
0027 namespace KileDialog {
0028 
0029 class TabularCellDelegate : public QStyledItemDelegate {
0030 public:
0031     explicit TabularCellDelegate(QTableWidget *parent = 0);
0032 
0033     virtual void paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const override;
0034 
0035     virtual QWidget *createEditor(QWidget *parent, const QStyleOptionViewItem &option,
0036                                   const QModelIndex &index) const override;
0037     virtual void setEditorData(QWidget *editor, const QModelIndex &index) const override;
0038     virtual void setModelData(QWidget *editor, QAbstractItemModel *model,
0039                               const QModelIndex &index) const override;
0040     virtual void updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option,
0041                                       const QModelIndex &index) const override;
0042 
0043 private:
0044     QTableWidget *m_Table;
0045 };
0046 
0047 }
0048 
0049 #endif