TableAction

Qualified name: mv::gui::TableAction

class TableAction : public mv::gui::VerticalGroupAction

Table action class.

Action class for interacting with a model in a table view

Author

Thomas Kroes

Public Functions

Q_INVOKABLE TableAction(QObject *parent, const QString &title)

Construct with pointer to parent object and title.

Parameters:
  • parent – Pointer to parent object

  • title – Title of the action

void initialize(QAbstractItemModel *model, QSortFilterProxyModel *filterModel, const QString &itemTypeName)

Initializes the table action with a pointer to a model, possibly a filterModel and itemTypeName.

Parameters:
  • model – Pointer to model

  • filterModel – Pointer to filter model (maybe nullptr)

  • itemTypeName – Item type name string

inline QAbstractItemModel *getModel()

Get model.

Returns:

Pointer to model (maybe nullptr)

inline QSortFilterProxyModel *getFilterModel()

Get filter model.

Returns:

Pointer to filter model (maybe nullptr)

inline QItemSelectionModel &getSelectionModel()

Get selection model.

Returns:

Reference to selection model

inline QString getItemTypeName()

Get item type name.

Returns:

Item type name string

Protected Functions

inline virtual QWidget *getWidget(QWidget *parent, const std::int32_t &widgetFlags) override

Get widget representation of the tree action.

Parameters:
  • parent – Pointer to parent widget

  • widgetFlagsWidget flags for the configuration of the widget (type)

class Widget : public mv::gui::WidgetActionWidget

Widget class for table action.

Protected Functions

Widget(QWidget *parent, TableAction *tableAction, const std::int32_t &widgetFlags)

Construct with pointer to parent widget, treeAction and widgetFlags.

Parameters:
  • parent – Pointer to parent widget

  • tableAction – Pointer to owning table action

  • widgetFlagsWidget flags

Protected Attributes

QTableView _tableView

Pointer to owning table action.

InfoOverlayWidget _infoOverlayWidget

Table view for showing the data.

QString _noItemsDescription

Overlay widget that show information when there are no items in the model.

HorizontalHeaderAction _horizontalHeaderAction

Overlay widget description when no items are loaded.

Friends

friend class TableAction