fixed resizing of items when resizing the item list

This commit is contained in:
csoler 2020-09-13 20:32:56 +02:00
parent 01683aac4e
commit a6a3bd3f0f
3 changed files with 10 additions and 0 deletions

View File

@ -292,7 +292,9 @@ void PostedListWidgetWithModel::updateSorting(int s)
void PostedListWidgetWithModel::handlePostsTreeSizeChange(QSize size)
{
std::cerr << "resizing!"<< std::endl;
mPostedPostsDelegate->setCellWidth(size.width());
mPostedPostsModel->triggerRedraw();
}
void PostedListWidgetWithModel::filterItems(QString text)

View File

@ -143,6 +143,11 @@ void RsPostedPostsModel::update()
{
emit dataChanged(createIndex(0,0,(void*)NULL), createIndex(mDisplayedNbPosts,0,(void*)NULL));
}
void RsPostedPostsModel::triggerRedraw()
{
preMods();
postMods();
}
void RsPostedPostsModel::setFilter(const QStringList& strings, uint32_t& count)
{

View File

@ -141,6 +141,9 @@ public:
// Triggers a preMod, begin/end remove rows and data update. Could be useful if update is not enough to reset cell sizes.
void deepUpdate();
// same without data update, which is far less costly
void triggerRedraw();
#ifdef TODO
void setSortMode(SortMode mode) ;