Qt Virtual Chart Table (QVCT)
COverlayBaseTree.hpp
Go to the documentation of this file.
1 // INDENTING (emacs/vi): -*- mode:c++; tab-width:2; c-basic-offset:2; intent-tabs-mode:nil; -*- ex: set tabstop=2 expandtab:
2 
3 /*
4  * Qt Virtual Chart Table (QVCT)
5  * Copyright (C) 2012 Cedric Dufour <http://cedric.dufour.name>
6  * Author: Cedric Dufour <http://cedric.dufour.name>
7  *
8  * The Qt Virtual Chart Table (QVCT) is free software:
9  * you can redistribute it and/or modify it under the terms of the GNU General
10  * Public License as published by the Free Software Foundation, Version 3.
11  *
12  * The Qt Virtual Chart Table (QVCT) is distributed in the hope
13  * that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
14  * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
15  *
16  * See the GNU General Public License for more details.
17  */
18 
19 #ifndef QVCT_COVERLAYBASETREE_HPP
20 #define QVCT_COVERLAYBASETREE_HPP
21 
22 // QT
23 #include <QTreeWidget>
24 #include <QWidget>
25 
26 // QVCT
27 #include "overlays/COverlay.hpp"
28 
29 
31 
37 class COverlayBaseTree: public QTreeWidget, public COverlay
38 {
39  Q_OBJECT
40 
41  //------------------------------------------------------------------------------
42  // FIELDS
43  //------------------------------------------------------------------------------
44 
45 private:
47 
49 
50 
51  //------------------------------------------------------------------------------
52  // CONSTRUCTORS / DESTRUCTOR
53  //------------------------------------------------------------------------------
54 
55 protected:
56  COverlayBaseTree( QWidget* _pqParent, const QString& _rqsName );
57  virtual ~COverlayBaseTree() {};
58 
59 
60  //------------------------------------------------------------------------------
61  // METHODS
62  //------------------------------------------------------------------------------
63 
64  // SLOTS
65 private slots:
67  void slotCurrentItemChanged( QTreeWidgetItem* _pqTreeWidgetItem, QTreeWidgetItem* _pqTreeWidgetItemPrevious );
69  void slotItemClicked( QTreeWidgetItem* _pqTreeWidgetItem, int _iColumn );
71  void slotItemDoubleClicked( QTreeWidgetItem* _pqTreeWidgetItem, int _iColumn );
73  void slotItemChanged( QTreeWidgetItem* _pqTreeWidgetItem, int _iColumn );
74 
75  // OTHER
76 protected:
78  void destroy();
79 public:
81  virtual void onChange( QTreeWidgetItem* _pqTreeWidgetItem, int __iColumn ) = 0;
82 
83 };
84 
85 #endif // QVCT_COVERLAYBASETREE_HPP
Generic overlay base (tree widget)
void slotItemChanged(QTreeWidgetItem *_pqTreeWidgetItem, int _iColumn)
Slot to handle item (content) changes in the underlying QTreeWidget.
void slotItemDoubleClicked(QTreeWidgetItem *_pqTreeWidgetItem, int _iColumn)
Slot to handle item double-click in the underlying QTreeWidget.
virtual ~COverlayBaseTree()
void destroy()
Prepare the underlying QTreeWidget for destruction.
bool bCurrentItemJustChanged
Flag to track when the focused item just changed.
COverlayBaseTree(QWidget *_pqParent, const QString &_rqsName)
void slotItemClicked(QTreeWidgetItem *_pqTreeWidgetItem, int _iColumn)
Slot to handle item click in the underlying QTreeWidget.
void slotCurrentItemChanged(QTreeWidgetItem *_pqTreeWidgetItem, QTreeWidgetItem *_pqTreeWidgetItemPrevious)
Slot to handle current item changes in the underlying QTreeWidget.
virtual void onChange(QTreeWidgetItem *_pqTreeWidgetItem, int __iColumn)=0
Handles item (content) changes in the underlying QTreeWidget.
Generic overlay.
Definition: COverlay.hpp:45