In QT:I craete a QMenu:
QMenu* popMenu = new QMenu(ui->treeWidget);
and I want to pop it above the current treewidgetitem, but what I only know is:
popMenu->exec(QCursor::pos());
So if I use:
ui->treeWidget->setCurrentItem(treeWidgetItem);//this is necessary for my program and the current item will be used elsewhere.
The menu will pop at the pos of the mouse-clicked pos not at the item. This looks wizard:( How can I pop the menu at the current item’s coordinates?