Route message link activation through the Qt conversation view
This commit is contained in:
1 parent
5b321c6304
commit
01fa1bc552
2 files changed
+4
-4
No files matched your search
@@ -338,7 +338,7 @@ MessageList::MessageList(DbManager* db, AudioRecorder* recorder, QWidget *parent
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
layout->setSpacing(0);
|
||||
|
||||
connect(m_view, &ChatView::inviteLinkActivated, this, &MessageList::inviteLinkActivated);
|
||||
connect(m_view, &ChatView::linkActivated, this, &MessageList::linkActivated);
|
||||
|
||||
/* ── шапка чата: название канала + переключатель рации ── */
|
||||
{
|
||||
@@ -415,9 +415,9 @@ MessageList::MessageList(DbManager* db, AudioRecorder* recorder, QWidget *parent
|
||||
|
||||
m_view->setModel(m_model);
|
||||
auto* msgDelegate = new MessageDelegate(this);
|
||||
m_view->setInviteHitTest([this, msgDelegate](const QModelIndex& index, const QPoint& point) {
|
||||
m_view->setLinkHitTest([this, msgDelegate](const QModelIndex& index, const QPoint& point) {
|
||||
QStyleOptionViewItem option; option.initFrom(m_view); option.widget = m_view; option.rect = m_view->visualRect(index);
|
||||
return msgDelegate->inviteLinkAt(option, index, point);
|
||||
return msgDelegate->linkAt(option, index, point);
|
||||
});
|
||||
msgDelegate->setVideoOpenCallback([this](const QString& path) {
|
||||
emit openVideoRequested(path);
|
||||
|
||||
Reference in new issue
Block a user