Seamly2D
Code documentation
vpropertytreeview.h
Go to the documentation of this file.
1 /************************************************************************
2  **
3  ** @file vpropertytreeview.h
4  ** @author hedgeware <internal(at)hedgeware.net>
5  ** @date
6  **
7  ** @brief
8  ** @copyright
9  ** All rights reserved. This program and the accompanying materials
10  ** are made available under the terms of the GNU Lesser General Public License
11  ** (LGPL) version 2.1 which accompanies this distribution, and is available at
12  ** http://www.gnu.org/licenses/lgpl-2.1.html
13  **
14  ** This library is distributed in the hope that it will be useful,
15  ** but WITHOUT ANY WARRANTY; without even the implied warranty of
16  ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17  ** Lesser General Public License for more details.
18  **
19  *************************************************************************/
20 
21 #ifndef VPROPERTYTREEVIEW_H
22 #define VPROPERTYTREEVIEW_H
23 
24 #include <qcompilerdetection.h>
25 #include <QMetaObject>
26 #include <QObject>
27 #include <QString>
28 #include <QTreeView>
29 #include <QtGlobal>
30 
31 namespace VPE
32 {
33 
34 class VPropertyDelegate;
35 class VPropertyModel;
36 class VPropertyTreeViewPrivate;
37 
38 class VPropertyTreeView : public QTreeView
39 {
40  Q_OBJECT
41 public:
42  //! Default constructor
43  explicit VPropertyTreeView(QWidget *parent = nullptr);
44 
45  //! The destructor, taking a model and setting it to the tree view
46  //! \param model The model to set as model for this tree view
47  explicit VPropertyTreeView(VPropertyModel* model, QWidget *parent = nullptr);
48 
49  //! Destructor
50  virtual ~VPropertyTreeView() Q_DECL_OVERRIDE;
51 
52  //! Sets the height for each row. Set this to 0 in order to let the standard delegate decide
53  void setRowHeight(int height = 0, bool add_to_standard = false);
54 
55 
56 protected:
57  //! This method is called by the constructors to initialize the view
58  virtual void init();
59 
60  //! protected constructor
61  VPropertyTreeView(VPropertyTreeViewPrivate* d, bool init_, QWidget *parent = nullptr);
62 
63  //! The protected data
65 
66 private:
67  Q_DISABLE_COPY(VPropertyTreeView)
68 };
69 
70 }
71 
72 #endif // VPROPERTYTREEVIEWEEVIEW_H
This is the base model for managing all the properties and passing them to the view.
void setRowHeight(int height=0, bool add_to_standard=false)
Sets the height for each row. Set this to 0 in order to let the standard delegate decide.
virtual ~VPropertyTreeView() Q_DECL_OVERRIDE
Destructor.
virtual void init()
This method is called by the constructors to initialize the view.
VPropertyTreeView(QWidget *parent=nullptr)
Default constructor.
VPropertyTreeViewPrivate * d_ptr
The protected data.