Seamly2D
Code documentation
VPE::VPropertyFormView Class Reference

This class populates a form layout with the properties in a model. More...

#include <vpropertyformview.h>

Inheritance diagram for VPE::VPropertyFormView:
Collaboration diagram for VPE::VPropertyFormView:

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
VPropertyFormWidgetPrivated_ptr
 The protected data. More...
 

Detailed Description

This class populates a form layout with the properties in a model.

Definition at line 39 of file vpropertyformview.h.

Constructor & Destructor Documentation

◆ VPropertyFormView() [1/3]

VPE::VPropertyFormView::VPropertyFormView ( QWidget *  parent = nullptr)
explicit

Constructor.

Definition at line 31 of file vpropertyformview.cpp.

◆ VPropertyFormView() [2/3]

VPE::VPropertyFormView::VPropertyFormView ( VPropertyModel model,
QWidget *  parent = nullptr 
)
explicit

Constructor.

Definition at line 37 of file vpropertyformview.cpp.

References setModel().

◆ VPropertyFormView() [3/3]

VPE::VPropertyFormView::VPropertyFormView ( VPropertySet property_set,
QWidget *  parent = nullptr 
)
explicit

Constructor.

Definition at line 43 of file vpropertyformview.cpp.

References setPropertySet().

◆ ~VPropertyFormView()

VPE::VPropertyFormView::~VPropertyFormView ( )
virtual

Destructor.

Definition at line 49 of file vpropertyformview.cpp.

Member Function Documentation

◆ build

void VPE::VPropertyFormView::build ( )
virtualslot

Rebuilds the whole form.

Definition at line 54 of file vpropertyformview.cpp.

References VPE::VPropertyFormWidget::build().

◆ connectPropertyFormWidget()

void VPE::VPropertyFormView::connectPropertyFormWidget ( VPropertyFormWidget widget)
protectedvirtual

Function to handle newly created VPropertyWidgets.

Definition at line 204 of file vpropertyformview.cpp.

References dataSubmitted(), VPE::VPropertyFormWidget::getChildPropertyFormWidgets(), and VPE::VPropertyFormWidget::propertyDataSubmitted().

◆ dataChanged

void VPE::VPropertyFormView::dataChanged ( const QModelIndex &  top_left,
const QModelIndex &  bottom_right 
)
privateslot

Called when data in the model gets changed.

Definition at line 134 of file vpropertyformview.cpp.

◆ dataSubmitted

void VPE::VPropertyFormView::dataSubmitted ( VProperty property)
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().

◆ modelDestroyed

void VPE::VPropertyFormView::modelDestroyed ( )
privateslot

Called, when the model gets destroyed.

Definition at line 128 of file vpropertyformview.cpp.

Referenced by setModel().

◆ modelReset

void VPE::VPropertyFormView::modelReset ( )
slot

Called when the model is being reset.

Definition at line 123 of file vpropertyformview.cpp.

Referenced by setModel().

◆ removeModelAndSet()

void VPE::VPropertyFormView::removeModelAndSet ( )
protected

Removes the model and property set if they were set.

Definition at line 191 of file vpropertyformview.cpp.

References VPE::VPropertyFormWidgetPrivate::Properties.

◆ rowsInserted

void VPE::VPropertyFormView::rowsInserted ( const QModelIndex &  parent,
int  start,
int  end 
)
slot

Called when a new row is being inserted into the model.

Definition at line 114 of file vpropertyformview.cpp.

Referenced by setModel().

◆ rowsRemoved

void VPE::VPropertyFormView::rowsRemoved ( const QModelIndex &  parent,
int  start,
int  end 
)
slot

Called when a row gets removed in the model.

Definition at line 105 of file vpropertyformview.cpp.

Referenced by setModel().

◆ setModel

void VPE::VPropertyFormView::setModel ( VPropertyModel model)
slot

Set the source model. Leads to the rebuild of the form.

Parameters
modelThe 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().

◆ setPropertySet

void VPE::VPropertyFormView::setPropertySet ( VPropertySet property_set)
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.

Parameters
property_setThe property set to use

Definition at line 88 of file vpropertyformview.cpp.

References VPE::VPropertySet::getRootProperties().

Referenced by VPropertyFormView().

◆ showEvent()

void VPE::VPropertyFormView::showEvent ( QShowEvent *  event)
protectedvirtual

Definition at line 157 of file vpropertyformview.cpp.

◆ updatePropertyList()

void VPE::VPropertyFormView::updatePropertyList ( )
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.


The documentation for this class was generated from the following files: