Pages
API Documentation
On this page

KNSCore::CommentsModel Class

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)
  • Inherits: QAbstractListModel

List of all members, including inherited members

Public Types

Properties

Public Functions

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

Constant
KNSCore::CommentsModel::SubjectRole Qt::DisplayRole
KNSCore::CommentsModel::IdRole Qt::UserRole + 1
KNSCore::CommentsModel::TextRole 258
KNSCore::CommentsModel::ChildCountRole 259
KNSCore::CommentsModel::UsernameRole 260
KNSCore::CommentsModel::DateRole 261
KNSCore::CommentsModel::ScoreRole 262
KNSCore::CommentsModel::ParentIndexRole 263
KNSCore::CommentsModel::DepthRole 264

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)

We use cookies to personalize content and to analyze our traffic. Please decide if you are willing to accept cookies from our website.