LeechCraft  0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
LC::Util::UnhideListViewBase Class Reference

Base class for a view of a list of items to be unclosed. More...

#include "unhidelistviewbase.h"

+ Inheritance diagram for LC::Util::UnhideListViewBase:
+ Collaboration diagram for LC::Util::UnhideListViewBase:

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_
 

Detailed Description

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.

See also
UnhideListModel

Definition at line 36 of file unhidelistviewbase.h.

Constructor & Destructor Documentation

◆ UnhideListViewBase()

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.

Parameters
[in]proxyThe pointer to an ICoreProxy instance.
[in]modelFillerA function filling the model with the items, or an empty function.
[in]parentThe parent widget of this view.
See also
UnhideListModel

Definition at line 28 of file unhidelistviewbase.cpp.

Member Function Documentation

◆ itemUnhideRequested

void LC::Util::UnhideListViewBase::itemUnhideRequested ( const QString &  itemId)
signal

Emitted when an item with the given itemId is activated.

Parameters
[out]itemIdThe ID of the activated item, equal to UnhideListModel::Roles::ItemClass.
See also
UnhideListModel::Roles::ItemClass

◆ SetItems()

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.

Parameters
[in]itemsThe items to be added to the view model.
See also
UnhideListModel

Definition at line 69 of file unhidelistviewbase.cpp.

Member Data Documentation

◆ Model_

UnhideListModel* const LC::Util::UnhideListViewBase::Model_
protected

Definition at line 40 of file unhidelistviewbase.h.


The documentation for this class was generated from the following files: