added edit mode

This commit is contained in:
csoler 2020-07-04 23:00:48 +02:00
parent 75cf9d6c86
commit 7cec536904
No known key found for this signature in database
GPG Key ID: 7BCA522266C0804C

View File

@ -275,14 +275,6 @@ QModelIndex RsPostedPostsModel::parent(const QModelIndex& index) const
return QModelIndex(); // there's no hierarchy here. So nothing to do!
}
Qt::ItemFlags RsPostedPostsModel::flags(const QModelIndex& index) const
{
if (!index.isValid())
return 0;
return QAbstractItemModel::flags(index);
}
quintptr RsPostedPostsModel::getChildRef(quintptr ref,int index) const
{
if (index < 0)
@ -433,6 +425,14 @@ bool operator<(const RsPostedPost& p1,const RsPostedPost& p2)
return p1.mMeta.mPublishTs > p2.mMeta.mPublishTs;
}
Qt::ItemFlags RsPostedPostsModel::flags(const QModelIndex& index) const
{
if (!index.isValid())
return 0;
return QAbstractItemModel::flags(index) | Qt::ItemIsEditable;
}
void RsPostedPostsModel::setPosts(const RsPostedGroup& group, std::vector<RsPostedPost>& posts)
{
preMods();