This class populates a form layout with the properties in a model. More...
#include <vpropertyformview.h>
Public Slots | |
virtual void | build () Q_DECL_OVERRIDE |
Rebuilds the whole form. More... | |
void | setModel (VPropertyModel *model) |
Set the source model. Leads to the rebuild of the form. More... | |
void | setPropertySet (VPropertySet *property_set) |
Set the property set to use. Note that if using a property set directly, adding and removing properties to the property set leads to undifined behaviour for the property set misses notification signals. More... | |
void | rowsRemoved (const QModelIndex &parent, int start, int end) |
Called when a row gets removed in the model. More... | |
void | rowsInserted (const QModelIndex &parent, int start, int end) |
Called when a new row is being inserted into the model. More... | |
void | modelReset () |
Called when the model is being reset. More... | |
Public Slots inherited from VPE::VPropertyFormWidget | |
virtual void | build () |
Rebuilds the whole form. More... | |
void | buildEditor (VProperty *property, QFormLayout *formLayout, Property type=Property::Simple) |
void | commitData () |
Reads the data from the editors and commits it to the properties. More... | |
void | loadData () |
Refills the editors with the propertie's data. More... | |
void | commitData (int row) |
Reads the data from row'th editor and commits it to the property. More... | |
void | loadData (int row) |
Reads the data from row'th property. More... | |
void | setCommitBehaviour (bool auto_commit=true) |
Sets the update behaviour. More... | |
Public Member Functions | |
VPropertyFormView (QWidget *parent=nullptr) | |
Constructor. More... | |
VPropertyFormView (VPropertyModel *model, QWidget *parent=nullptr) | |
Constructor. More... | |
VPropertyFormView (VPropertySet *property_set, QWidget *parent=nullptr) | |
Constructor. More... | |
virtual | ~VPropertyFormView () Q_DECL_OVERRIDE |
Destructor. More... | |
Public Member Functions inherited from VPE::VPropertyFormWidget | |
VPropertyFormWidget (const QString &title, const QString &description, const QList< VProperty * > &properties, QWidget *parent) | |
Constructor. More... | |
VPropertyFormWidget (VProperty *parent_property, QWidget *parent) | |
Constructor. More... | |
~VPropertyFormWidget () | |
Destructor. More... | |
QList< VPropertyFormWidget * > | getChildPropertyFormWidgets () const |
Returns a list of all child property form widgets (note that indirect children will not be in the list) More... | |
Protected Member Functions | |
virtual void | showEvent (QShowEvent *event) Q_DECL_OVERRIDE |
void | updatePropertyList () |
Rebuilds the widegt only if it is visible. More... | |
void | removeModelAndSet () |
Removes the model and property set if they were set. More... | |
virtual void | connectPropertyFormWidget (VPropertyFormWidget *widget) |
Function to handle newly created VPropertyWidgets. More... | |
Protected Member Functions inherited from VPE::VPropertyFormWidget | |
VPropertyFormWidget (VPropertyFormWidgetPrivate *d_pointer, QWidget *parent, const QString &title=QString(), const QString &description=QString()) | |
Protected Constructor. More... | |
bool | eventFilter (QObject *object, QEvent *event) |
Event filter for the editor widgets. More... | |
void | commitData (const QWidget *editor) |
Commits data of an editor. More... | |
Private Slots | |
void | modelDestroyed () |
Called, when the model gets destroyed. More... | |
void | dataChanged (const QModelIndex &top_left, const QModelIndex &bottom_right) |
Called when data in the model gets changed. More... | |
void | dataSubmitted (VProperty *property) |
Updates the model when data was submitted by the view. More... | |
Additional Inherited Members | |
Signals inherited from VPE::VPropertyFormWidget | |
void | propertyDataSubmitted (VProperty *property) |
Emitted whenever a property data changes. More... | |
Protected Attributes inherited from VPE::VPropertyFormWidget | |
VPropertyFormWidgetPrivate * | d_ptr |
The protected data. More... | |
This class populates a form layout with the properties in a model.
Definition at line 39 of file vpropertyformview.h.
|
explicit |
Constructor.
Definition at line 31 of file vpropertyformview.cpp.
|
explicit |
|
explicit |
|
virtual |
Destructor.
Definition at line 49 of file vpropertyformview.cpp.
|
virtualslot |
Rebuilds the whole form.
Definition at line 54 of file vpropertyformview.cpp.
References VPE::VPropertyFormWidget::build().
|
protectedvirtual |
Function to handle newly created VPropertyWidgets.
Definition at line 204 of file vpropertyformview.cpp.
References dataSubmitted(), VPE::VPropertyFormWidget::getChildPropertyFormWidgets(), and VPE::VPropertyFormWidget::propertyDataSubmitted().
|
privateslot |
Called when data in the model gets changed.
Definition at line 134 of file vpropertyformview.cpp.
|
privateslot |
Updates the model when data was submitted by the view.
Definition at line 145 of file vpropertyformview.cpp.
References VPE::VPropertyModel::onDataChangedByModel().
Referenced by connectPropertyFormWidget().
|
privateslot |
Called, when the model gets destroyed.
Definition at line 128 of file vpropertyformview.cpp.
Referenced by setModel().
|
slot |
Called when the model is being reset.
Definition at line 123 of file vpropertyformview.cpp.
Referenced by setModel().
|
protected |
Removes the model and property set if they were set.
Definition at line 191 of file vpropertyformview.cpp.
References VPE::VPropertyFormWidgetPrivate::Properties.
|
slot |
Called when a new row is being inserted into the model.
Definition at line 114 of file vpropertyformview.cpp.
Referenced by setModel().
|
slot |
Called when a row gets removed in the model.
Definition at line 105 of file vpropertyformview.cpp.
Referenced by setModel().
|
slot |
Set the source model. Leads to the rebuild of the form.
model | The model to use |
Definition at line 62 of file vpropertyformview.cpp.
References VPE::VPropertyModel::getPropertySet(), VPE::VPropertySet::getRootProperties(), modelDestroyed(), modelReset(), rowsInserted(), and rowsRemoved().
Referenced by VPropertyFormView().
|
slot |
Set the property set to use. Note that if using a property set directly, adding and removing properties to the property set leads to undifined behaviour for the property set misses notification signals.
property_set | The property set to use |
Definition at line 88 of file vpropertyformview.cpp.
References VPE::VPropertySet::getRootProperties().
Referenced by VPropertyFormView().
|
protectedvirtual |
Definition at line 157 of file vpropertyformview.cpp.
|
protected |
Rebuilds the widegt only if it is visible.
Definition at line 167 of file vpropertyformview.cpp.
References VPE::VPropertyModel::getPropertySet(), VPE::VPropertySet::getRootProperties(), and VPE::VPropertyFormWidgetPrivate::Properties.