KPageModel Class
A base class for a model used by KPageView. More...
- Header:
#include <KPageModel> - CMake:
find_package(KF6 REQUIRED COMPONENTS WidgetsAddons)
target_link_libraries(mytarget PRIVATE KF6::WidgetsAddons) - Inherits: QAbstractItemModel
- Inherited By: KPageWidgetModel
List of all members, including inherited members
Public Types
Public Functions
Detailed Description
This class is an abstract base class which must be used to implement custom models for KPageView. Additional to the standard Qt::ItemDataRoles it provides the two roles
which are used to return a header string for a page and a QWidget pointer to the page itself.
Example:
KPageView *view = new KPageView( this );
KPageModel *model = new MyPageModel( this );
view->setModel( model );
See also KPageView
Member Type Documentation
enum KPageModel::Role
Additional roles that KPageView uses.
| Constant | Value | Description |
|---|---|---|
KPageModel::HeaderRole |
Qt::UserRole + 1 |
A string to be rendered as page header. |
KPageModel::WidgetRole |
258 |
A pointer to the page widget. This is the widget that is shown when the item is selected. You can make QVariant take a QWidget using cpp QWidget *myWidget = new QWidget; QVariant v = QVariant::fromValue(myWidget); |
KPageModel::When (since Qt 5.52) |
? | true, show the page header, if false don't |
KPageModel::The (since Qt 6.6) |
? | list of actions associated to the page |
Member Function Documentation
[explicit] KPageModel::KPageModel(QObject *parent = nullptr)
Constructs a page model with the given parent.