I would like to create a context menu for a QTreeView. I tried this:
treeView->addAction( action1 );
treeView->setContextMenuPolicy(Qt::ActionsContextMenu);
My problem is that the right-click which pops up the context menu should move the selection to the right-clicked cell before the menu pops up. Just like MS excell works for example. But selection is unchanged. Is there some common solution for this? Should I set the Qt::CustomContextMenu policy, or install an event filter and do everything manually?