ImFusion SDK 4.3
ItemViewWidget Class Reference

#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:

Detailed Description

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 Types

enum class  Option {
  None = 0x0 , Add = 1 << 0x1 , Remove = 1 << 0x2 , Clear = 1 << 0x3 ,
  Edit = 1 << 0x4 , Sort = 1 << 0x5 , ChangeOrder = 1 << 0x6 , All = 0xFF
}
 
enum class  OptionsPosition { Above , Under , Left , Right }
 

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.
 

Constructor & Destructor Documentation

◆ 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.


The documentation for this class was generated from the following file:
Search Tab / S to search, Esc to close