![]() |
LeechCraft
0.6.70-13729-g7046a9d2a7
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 (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 59 of file unhidelistviewbase.h.
LC::Util::UnhideListViewBase::UnhideListViewBase | ( | 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 46 of file unhidelistviewbase.cpp.
References LC::Util::EnableTransparency(), LC::Util::GetPathCandidates(), LC::Util::GetSysPath(), itemUnhideRequested(), Model_, and LC::Util::QML.
|
signal |
Emitted when an item with the given itemId is activated.
[out] | itemId | The ID of the activated item, equal to UnhideListModel::Roles::ItemClass. |
Referenced by UnhideListViewBase().
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 87 of file unhidelistviewbase.cpp.
References Model_.
|
protected |
Definition at line 63 of file unhidelistviewbase.h.
Referenced by SetItems(), and UnhideListViewBase().