Seamly2D
Code documentation
vpropertyformwidget.h
Go to the documentation of this file.
1
/************************************************************************
2
**
3
** @file vpropertyformwidget.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 VPROPERTYFORMWIDGET_H
22
#define VPROPERTYFORMWIDGET_H
23
24
#include <QGroupBox>
25
#include <QLabel>
26
#include <QList>
27
#include <QMetaObject>
28
#include <QObject>
29
#include <QString>
30
#include <QtGlobal>
31
32
#include "
vproperty.h
"
33
34
class
QFormLayout;
35
36
namespace
VPE
37
{
38
39
class
VPropertyFormWidgetPrivate;
40
class
VPropertySet;
41
42
//! Class that displays the sub properties of a property using a form layout
43
class
VPropertyFormWidget
:
public
QGroupBox
44
{
45
Q_OBJECT
46
public
:
47
//! Constructor
48
VPropertyFormWidget
(
const
QString &title,
const
QString &description,
const
QList<VProperty*>
&properties,
49
QWidget* parent);
50
51
//! Constructor
52
VPropertyFormWidget
(
VProperty
*parent_property, QWidget *parent);
53
54
//! Destructor
55
~VPropertyFormWidget
();
56
57
58
//! Returns a list of all child property form widgets (note that indirect children will not be in the list)
59
QList<VPropertyFormWidget*>
getChildPropertyFormWidgets
()
const
;
60
61
public
slots:
62
//! Rebuilds the whole form
63
virtual
void
build
();
64
65
void
buildEditor
(
VProperty
*property, QFormLayout *formLayout,
Property
type =
Property::Simple
);
66
67
//! Reads the data from the editors and commits it to the properties
68
void
commitData
();
69
70
//! Refills the editors with the propertie's data
71
void
loadData
();
72
73
//! Reads the data from row'th editor and commits it to the property
74
void
commitData
(
int
row);
75
76
//! Reads the data from row'th property
77
void
loadData
(
int
row);
78
79
//! Sets the update behaviour
80
//! \param auto_commit If set to true, whenever an event like focusOut is triggered on an editor, the data will be
81
//! submitted to the property.
82
void
setCommitBehaviour
(
bool
auto_commit =
true
);
83
84
signals:
85
//! Emitted whenever a property data changes
86
void
propertyDataSubmitted
(
VProperty
*property);
87
88
protected
:
89
//! Protected Constructor
90
VPropertyFormWidget
(
VPropertyFormWidgetPrivate
*d_pointer, QWidget *parent,
const
QString &title = QString(),
91
const
QString &description = QString());
92
93
//! The protected data
94
VPropertyFormWidgetPrivate
*
d_ptr
;
95
96
//! Event filter for the editor widgets
97
bool
eventFilter
(QObject *
object
, QEvent *event);
98
99
//! Commits data of an editor
100
void
commitData
(
const
QWidget *editor);
101
102
private
:
103
Q_DISABLE_COPY(
VPropertyFormWidget
)
104
};
105
106
}
// Namespace VPE
107
108
#endif
// VPROPERTYFORMWIDGET_H
QList
Definition:
vlayoutpaper.h:70
VPE::VPropertyFormWidgetPrivate
Definition:
vpropertyformwidget_p.h:37
VPE::VPropertyFormWidget
Class that displays the sub properties of a property using a form layout.
Definition:
vpropertyformwidget.h:44
VPE::VPropertyFormWidget::propertyDataSubmitted
void propertyDataSubmitted(VProperty *property)
Emitted whenever a property data changes.
VPE::VPropertyFormWidget::setCommitBehaviour
void setCommitBehaviour(bool auto_commit=true)
Sets the update behaviour.
Definition:
vpropertyformwidget.cpp:269
VPE::VPropertyFormWidget::getChildPropertyFormWidgets
QList< VPropertyFormWidget * > getChildPropertyFormWidgets() const
Returns a list of all child property form widgets (note that indirect children will not be in the lis...
Definition:
vpropertyformwidget.cpp:283
VPE::VPropertyFormWidget::d_ptr
VPropertyFormWidgetPrivate * d_ptr
The protected data.
Definition:
vpropertyformwidget.h:94
VPE::VPropertyFormWidget::VPropertyFormWidget
VPropertyFormWidget(const QString &title, const QString &description, const QList< VProperty * > &properties, QWidget *parent)
Constructor.
Definition:
vpropertyformwidget.cpp:38
VPE::VPropertyFormWidget::build
virtual void build()
Rebuilds the whole form.
Definition:
vpropertyformwidget.cpp:75
VPE::VPropertyFormWidget::loadData
void loadData()
Refills the editors with the propertie's data.
Definition:
vpropertyformwidget.cpp:208
VPE::VPropertyFormWidget::~VPropertyFormWidget
~VPropertyFormWidget()
Destructor.
Definition:
vpropertyformwidget.cpp:69
VPE::VPropertyFormWidget::buildEditor
void buildEditor(VProperty *property, QFormLayout *formLayout, Property type=Property::Simple)
Definition:
vpropertyformwidget.cpp:151
VPE::VPropertyFormWidget::commitData
void commitData()
Reads the data from the editors and commits it to the properties.
Definition:
vpropertyformwidget.cpp:200
VPE::VPropertyFormWidget::eventFilter
bool eventFilter(QObject *object, QEvent *event)
Event filter for the editor widgets.
Definition:
vpropertyformwidget.cpp:297
VPE::VProperty
Definition:
vproperty.h:57
VPE
Definition:
lineweight_property.h:46
VPE::Property
Property
Definition:
vproperty.h:43
VPE::Property::Simple
@ Simple
vproperty.h
src
libs
vpropertyexplorer
vpropertyformwidget.h
Generated by
1.9.1