LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
Base class for a view of a list of items to be unclosed. More...
#include "unhidelistviewbase.h"
Signals | |
void | itemUnhideRequested (const QString &itemId) |
Emitted when an item with the given itemId is activated. More... | |
Public Member Functions | |
UnhideListViewBase (const ICoreProxy_ptr &proxy, const std::function< void(UnhideListModel *)> &modelFiller, QWidget *parent=nullptr) | |
Initializes the view and fills it with the items. More... | |
void | SetItems (const QList< QStandardItem * > &items) |
Sets the items of the view model to items. More... | |
Protected Attributes | |
UnhideListModel *const | Model_ |
Base class for a view of a list of items to be unclosed.
This is a base class for widgets showing QML views with a list of items each of which can be unclosed, like a tab, a page, a button on a tab bar, and so on.
The view uses UnhideListModel internally, please refer to its documentation regarding various data roles defined by the model.
Definition at line 36 of file unhidelistviewbase.h.
LC::Util::UnhideListViewBase::UnhideListViewBase | ( | const ICoreProxy_ptr & | proxy, |
const std::function< void(UnhideListModel *)> & | modelFiller, | ||
QWidget * | parent = nullptr |
||
) |
Initializes the view and fills it with the items.
The model is filled by invoking the given modelFiller function at a proper time, which should in turn append the items as needed to the model passed to it.
The UnhideListModel is used as the model, so the passed modelFiller should set the appropriate data for the roles defined in UnhideListModel.
[in] | proxy | The pointer to an ICoreProxy instance. |
[in] | modelFiller | A function filling the model with the items, or an empty function. |
[in] | parent | The parent widget of this view. |
Definition at line 28 of file unhidelistviewbase.cpp.
|
signal |
Emitted when an item with the given itemId is activated.
[out] | itemId | The ID of the activated item, equal to UnhideListModel::Roles::ItemClass. |
void LC::Util::UnhideListViewBase::SetItems | ( | const QList< QStandardItem * > & | items | ) |
Sets the items of the view model to items.
Replaces any items previously added via the model filler passed to the UnhideListViewBase constructor.
The ownership of the items is transferred to the view.
The UnhideListModel is used as the model, so the passed modelFiller should set the appropriate data for the roles defined in UnhideListModel.
[in] | items | The items to be added to the view model. |
Definition at line 69 of file unhidelistviewbase.cpp.
|
protected |
Definition at line 40 of file unhidelistviewbase.h.