labplot  2.8.2
About: LabPlot is an application for plotting and analysis of 2D and 3D functions and data. It is a complete rewrite of LabPlot1 and lacks in the first release a lot of features available in the predecessor. On the other hand, the GUI and the usability is more superior.
  Fossies Dox: labplot-2.8.2.tar.gz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

SpreadsheetItemDelegate.h
Go to the documentation of this file.
1 /***************************************************************************
2  File : SpreadsheetItemDelegate.h
3  Project : SciDAVis
4  --------------------------------------------------------------------
5  Copyright : (C) 2007 by Tilman Benkert (thzs@gmx.net)
6  Copyright : (C) 2010-2017 by Alexander Semke (alexander.semke@web.de)
7 
8  ***************************************************************************/
9 
10 /***************************************************************************
11  * *
12  * This program is free software; you can redistribute it and/or modify *
13  * it under the terms of the GNU General Public License as published by *
14  * the Free Software Foundation; either version 2 of the License, or *
15  * (at your option) any later version. *
16  * *
17  * This program is distributed in the hope that it will be useful, *
18  * but WITHOUT ANY WARRANTY; without even the implied warranty of *
19  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
20  * GNU General Public License for more details. *
21  * *
22  * You should have received a copy of the GNU General Public License *
23  * along with this program; if not, write to the Free Software *
24  * Foundation, Inc., 51 Franklin Street, Fifth Floor, *
25  * Boston, MA 02110-1301 USA *
26  * *
27  ***************************************************************************/
28 
29 #ifndef SPREADSHEETITEMDELEGATE_H
30 #define SPREADSHEETITEMDELEGATE_H
31 
32 #include <QItemDelegate>
33 class QAbstractItemModel;
34 
35 class SpreadsheetItemDelegate : public QItemDelegate {
36  Q_OBJECT
37 
38 public:
39  explicit SpreadsheetItemDelegate(QObject* parent = nullptr);
40 
41  void paint(QPainter*, const QStyleOptionViewItem&, const QModelIndex&) const override;
42 
43  void setEditorData(QWidget*, const QModelIndex&) const override;
44  void setModelData(QWidget*, QAbstractItemModel*, const QModelIndex&) const override;
45 
46 private:
47  QColor m_maskingColor{0xff,0,0};
48  bool eventFilter(QObject*, QEvent*) override;
49 
50 signals:
51  void returnPressed();
52  void editorEntered();
53 };
54 
55 #endif
Item delegate for SpreadsheetView.
SpreadsheetItemDelegate(QObject *parent=nullptr)
void setEditorData(QWidget *, const QModelIndex &) const override
bool eventFilter(QObject *, QEvent *) override
void setModelData(QWidget *, QAbstractItemModel *, const QModelIndex &) const override
void paint(QPainter *, const QStyleOptionViewItem &, const QModelIndex &) const override