KNSCore::CommentsModel Class
class KNSCore::CommentsModelA 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
- entry : KNSCore::Entry
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
Constant | Value |
---|---|
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).