Hello.

I want to create popup menu on QListWidgets, so I create this:

Qt Code:
  1. listWidgets->setContextMenuPolicy(Qt::CustomContextMenu);
  2. connect(listWidgets, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(popupMenu(QPoint)));
To copy to clipboard, switch view to plain text mode 

and slot popupMenu:

Qt Code:
  1. void MainWindow::popupMenu(QPoint point) {
  2.  
  3. QMenu *popupMenu = new QMenu();
  4.  
  5. popupMenu->addAction("blabla");
  6.  
  7. popupMenu->popup(point);
  8.  
  9. }
To copy to clipboard, switch view to plain text mode 

All is ok because menu has been shown when I click right mouse button but not there where it should, it shows outside window application.

How can I fix it? How to create popup menu where I click?