From 401c57b412cd6ecc996cf8e4e8666004ef592e38 Mon Sep 17 00:00:00 2001 From: Leopixelo Date: Wed, 25 Jun 2025 14:58:05 +0200 Subject: [PATCH] make right click on CAN frames view grid work --- mainwindow.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mainwindow.cpp b/mainwindow.cpp index d27b437..71b8cce 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -48,6 +48,7 @@ MainWindow::MainWindow(QWidget *parent) : proxyModel->setSourceModel(model); ui->canFramesView->setModel(proxyModel); + ui->canFramesView->setSelectionMode(QAbstractItemView::NoSelection); settingsDialog = new MainSettingsDialog(); //instantiate the settings dialog so it can initialize settings if this is the first run or the config file was deleted. settingsDialog->updateSettings(); //write out all the settings. If this is the first run it'll write defaults out. @@ -728,8 +729,8 @@ void MainWindow::collapseAllRows() void MainWindow::gridClicked(QModelIndex idx) { - // do not expand or collapse row if a modifier key is pressed to be able to use the right click menu - if (QApplication::keyboardModifiers() != Qt::NoModifier) { + // do not expand or collapse row if press was a right mouse button press to be able to use the right click menu + if (QApplication::mouseButtons() & Qt::RightButton) { return; } //qDebug() << "Grid Clicked";