Include model roles and row actions required by subgroup details

This commit is contained in:
evgeny committed 2026-11-02 23:34:22 +01:00
1 parent 49b7ac9099
commit 780e7220c3
3 files changed
+11 -2

No files matched your search

+3 -2
View File
@@ -203,10 +203,11 @@ bool AccountDelegate::editorEvent(QEvent* event, QAbstractItemModel* model, cons
const bool header = index.data(GroupedMemberModel::GroupHeaderRole).toBool();
const bool self = index.data(Qt::UserRole + 2).toBool(), online = index.data(MemberListModel::OnlineRole).toBool();
Action action = actionAt(mouse->pos(), option.rect, header ? index.data(GroupedMemberModel::CallAvailableRole).toBool() : !self);
if (header && action == Action::None) action = Action::ToggleGroup;
if (header && action == Action::None && mouse->pos().x() < option.rect.left() + GroupedMemberModel::DisclosureWidth)
action = Action::ToggleGroup;
const bool isCall = action == Action::Call || action == Action::RadioCall;
const bool enabled = action == Action::Avatar || action == Action::ToggleGroup ||
(isCall ? index.data(GroupedMemberModel::CallAvailableRole).toBool() : !self && (!header || online));
(isCall ? (header ? index.data(GroupedMemberModel::CallAvailableRole).toBool() : !self && online) : !self && (!header || online));
if (event->type() == QEvent::MouseButtonPress) {
m_pressedIndex = action != Action::None && enabled ? index : QModelIndex();
m_pressedNodeId = index.data(GroupedMemberModel::ActionNodeIdRole).toULongLong();