Don't show context menu in Browse tab when not clicking on column header

When not clicking on an actual column header in the Browse Data tab
don't show the context menu. It's not working correctly anyway.

See issue #485.
This commit is contained in:
Martin Kleusberg
2016-01-27 22:37:17 +01:00
parent 93cdbd0f80
commit 0bfdc28f7a
+4 -1
View File
@@ -2358,7 +2358,10 @@ void MainWindow::showDataColumnPopupMenu(const QPoint& pos)
{
// Get the index of the column which the user has clicked on and store it in the action. This is sort of hack-ish and it might be the heat in my room
// but I haven't come up with a better solution so far
ui->actionBrowseTableEditDisplayFormat->setProperty("clicked_column", ui->dataTable->horizontalHeader()->logicalIndexAt(pos));
int logical_index = ui->dataTable->horizontalHeader()->logicalIndexAt(pos);
if(logical_index == -1) // Don't open the popup menu if the user hasn't clicked on a column header
return;
ui->actionBrowseTableEditDisplayFormat->setProperty("clicked_column", logical_index);
// Calculate the proper position for the context menu and display it
popupBrowseDataHeaderMenu->exec(ui->dataTable->horizontalHeader()->mapToGlobal(pos));