I created QMdiArea
in the main window, then I want to right click on the MDI area to get pop-up menu. To do this, I placed the following code in the constructor in the main window.
this->ui->mdiArea->setContextMenuPolicy(Qt::CustomContextMenu);
connect(this->ui->mdiArea, SIGNAL(customContextMenuRequested(const QPoint&)), this, SLOT(slotRtClickContextMenu(const QPoint&)))
The ContextMenu event happened as I checked it in the eventFilter.
However, there is no any response when I click at the MDI area. Then I replaced this->ui->mdiArea
with this, it worked well and showed the pop-up menu.
Any suggestions?