![]() |
ImFusion SDK 4.3
|
#include <ImFusion/GUI/CoreWidgets/ItemViewWidget.h>
Widget containing an abstract item view, reprensenting a model, as well as configurable options to edit the model. More...
Inheritance diagram for ItemViewWidget:Widget containing an abstract item view, reprensenting a model, as well as configurable options to edit the model.
ItemViewWidget::makeList and ItemViewWidget::makeTable are helper creator methods to create lists and tables easily, just by providing an ItemControl implementation and options about the desired controls and their position.
Public Member Functions | |
| ItemViewWidget (QAbstractItemView *view, QStandardItemModel *model, ItemControl *control, Flags< Option > options, OptionsPosition position, QWidget *parent) | |
| Constructor of an ItemViewWidget. | |
| QAbstractItemView * | view () |
| Returns the QAbstractItemView provided. | |
| QStandardItemModel * | model () |
| Returns the QStandardItemModel provided. | |
| QBoxLayout * | options () |
| Returns the QBoxLayout where the option buttons are added. Can be used to extend the layout with more buttons. | |
| QPushButton * | addButton () |
| Returns the QPushButton for the Add option. | |
| QPushButton * | removeButton () |
| Returns the QPushButton for the Remove option. | |
| QPushButton * | clearButton () |
| Returns the QPushButton for the Clear option. | |
| QPushButton * | editButton () |
| Returns the QPushButton for the Edit option. | |
| QPushButton * | sortButton () |
| Returns the QPushButton for the Sort option. | |
| QPushButton * | moveUpButton () |
| Returns the QPushButton for the MoveUp option. | |
| QPushButton * | moveDownButton () |
| Returns the QPushButton for the MoveDown option. | |
| void | clear () |
Static Public Member Functions | |
| static ListModelView | makeList (ItemControl *control, Flags< ItemViewWidget::Option > options={Option::All}, ItemViewWidget::OptionsPosition position=OptionsPosition::Above, QWidget *parent=nullptr) |
| Helper methods to generate QListView and a ItemViewWidget. | |
| static TableModelView | makeTable (ItemControl *control, Flags< ItemViewWidget::Option > options={Option::All}, ItemViewWidget::OptionsPosition position=OptionsPosition::Above, QWidget *parent=nullptr) |
| Helper methods to generate QTableView and a ItemViewWidget. | |
| ItemViewWidget | ( | QAbstractItemView * | view, |
| QStandardItemModel * | model, | ||
| ItemControl * | control, | ||
| Flags< Option > | options, | ||
| OptionsPosition | position, | ||
| QWidget * | parent ) |
Constructor of an ItemViewWidget.
It will absorb the provided View and Model, and provide a QWidget with a set of buttons specified in the Flags<Options>. The options can be positioned using the OptionsPosition parameter. A common use case is what makeList/makeTable provides, a QListView/QTableView and a QStandardItemModel with all the button options on top.