fixed auto-layout of thumbnails

This commit is contained in:
csoler 2020-06-06 19:07:03 +02:00
parent 3106157ab0
commit 129ffdd6c5
No known key found for this signature in database
GPG key ID: 7BCA522266C0804C
9 changed files with 89 additions and 26 deletions

View file

@ -32,7 +32,7 @@
#include "retroshare/rsgxschannels.h"
#include "retroshare/rsexpr.h"
#define DEBUG_CHANNEL_MODEL
//#define DEBUG_CHANNEL_MODEL
Q_DECLARE_METATYPE(RsMsgMetaData)
@ -221,6 +221,21 @@ Qt::ItemFlags RsGxsChannelPostsModel::flags(const QModelIndex& index) const
return QAbstractItemModel::flags(index);
}
void RsGxsChannelPostsModel::setNumColumns(int n)
{
preMods();
beginRemoveRows(QModelIndex(),0,rowCount()-1);
endRemoveRows();
mColumns = n;
beginInsertRows(QModelIndex(),0,rowCount()-1);
endInsertRows();
postMods();
}
quintptr RsGxsChannelPostsModel::getChildRef(quintptr ref,int index) const
{
if (index < 0)
@ -675,7 +690,7 @@ void RsGxsChannelPostsModel::setPosts(const RsGxsChannelGroup& group, std::vecto
{
preMods();
beginRemoveRows(QModelIndex(),0,mPosts.size()-1);
beginRemoveRows(QModelIndex(),0,rowCount()-1);
endRemoveRows();
mPosts.clear();
@ -692,7 +707,7 @@ void RsGxsChannelPostsModel::setPosts(const RsGxsChannelGroup& group, std::vecto
// debug_dump();
#endif
beginInsertRows(QModelIndex(),0,mPosts.size()-1);
beginInsertRows(QModelIndex(),0,rowCount()-1);
endInsertRows();
postMods();