Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F7889073
kazv-abstract-list-model.hpp
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Size
984 B
Referenced Files
None
Subscribers
None
kazv-abstract-list-model.hpp
View Options
/*
* This file is part of kazv.
* SPDX-FileCopyrightText: 2020-2024 tusooa <tusooa@kazv.moe>
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
#pragma once
#include
<kazv-defs.hpp>
#include
<QObject>
#include
<QQmlEngine>
#include
<QAbstractListModel>
#include
<lager/extra/qt.hpp>
class
KazvAbstractListModel
:
public
QAbstractListModel
{
Q_OBJECT
int
m_internalCount
;
public
:
enum
InitMethod
{
InitNow
,
InitLater
,
};
explicit
KazvAbstractListModel
(
lager
::
reader
<
int
>
count
,
InitMethod
initMethod
=
InitNow
,
QObject
*
parent
=
0
);
explicit
KazvAbstractListModel
(
QObject
*
parent
=
0
);
~
KazvAbstractListModel
()
override
;
LAGER_QT_READER
(
int
,
count
);
int
rowCount
(
const
QModelIndex
&
index
)
const
override
;
QVariant
data
(
const
QModelIndex
&
index
,
int
role
)
const
override
;
protected
:
void
initCountCursor
(
lager
::
reader
<
int
>
count
,
InitMethod
initMethod
=
InitNow
);
private
Q_SLOTS
:
void
updateInternalCount
();
};
File Metadata
Details
Attached
Mime Type
text/x-c++
Expires
Thu, Oct 2, 2:19 AM (19 h, 22 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
470744
Default Alt Text
kazv-abstract-list-model.hpp (984 B)
Attached To
Mode
rK kazv
Attached
Detach File
Event Timeline
Log In to Comment