Defer ChatProxy::invalidate() to avoid accessibility crash on macOS (QTBUG-95764)

This commit is contained in:
Gaelle Braud 2026-04-15 10:38:30 +02:00
parent 3e6132f099
commit 4b2ecde6bb

View file

@ -23,6 +23,8 @@
#include "ChatList.hpp"
#include "core/App.hpp"
#include <QTimer>
DEFINE_ABSTRACT_OBJECT(ChatProxy)
ChatProxy::ChatProxy(QObject *parent) {
@ -50,7 +52,8 @@ void ChatProxy::setSourceModel(QAbstractItemModel *model) {
emit chatAdded(new ChatGui(chatCore));
}
});
connect(newChatList, &ChatList::dataChanged, this, [this] { invalidate(); });
connect(newChatList, &ChatList::dataChanged, this,
[this] { QTimer::singleShot(0, this, [this] { invalidate(); }); });
newChatList->lUpdate();
}
QSortFilterProxyModel::setSourceModel(newChatList);