KNSCore::CommentsModel Class

class KNSCore::CommentsModel

A model which takes care of the comments for a single Entry. More...

Header: #include <CommentsModel>
CMake: find_package(KF6 REQUIRED COMPONENTS NewStuff)
target_link_libraries(mytarget PRIVATE KF6::NewStuff)
Since: 5.63
Inherits: QAbstractListModel

Public Types

enum Roles { SubjectRole, IdRole, TextRole, ChildCountRole, UsernameRole, …, DepthRole }

Properties

Public Functions

CommentsModel(KNSCore::EngineBase *parent = nullptr)
const KNSCore::Entry &entry() const
void setEntry(const KNSCore::Entry &newEntry)

Signals

void entryChanged()

Detailed Description

Note: This model should preferably be constructed by asking the Engine to give a model instance to you for a specific entry using the commentsForEntry function. If you insist, you can construct an instance yourself as well, but this is not recommended.

See also Engine::commentsForEntry(KNSCore::Entry).

Member Type Documentation

enum CommentsModel::Roles

ConstantValue
KNSCore::CommentsModel::SubjectRoleQt::DisplayRole
KNSCore::CommentsModel::IdRoleQt::UserRole + 1
KNSCore::CommentsModel::TextRole258
KNSCore::CommentsModel::ChildCountRole259
KNSCore::CommentsModel::UsernameRole260
KNSCore::CommentsModel::DateRole261
KNSCore::CommentsModel::ScoreRole262
KNSCore::CommentsModel::ParentIndexRole263
KNSCore::CommentsModel::DepthRole264

Property Documentation

entry : KNSCore::Entry

The Entry for which this model should handle comments

Access functions:

const KNSCore::Entry &entry() const
void setEntry(const KNSCore::Entry &newEntry)

Notifier signal:

void entryChanged()

Member Function Documentation

[explicit] CommentsModel::CommentsModel(KNSCore::EngineBase *parent = nullptr)

Construct a new CommentsModel instance.

Note: The class is intended to be constructed using the Engine::commentsForEntry function

See also Engine::commentsForEntry(KNSCore::Entry).