Right click on the view, nothing happens, here's the code:
connect(view,
SIGNAL(customContextMenuRequested
( const QPoint &)),
this,
SLOT(viewMenu
(const QPoint &)));
void MainWindow
::viewMenu(const QPoint & pos
) {
viewMenu->setContextMenuPolicy(Qt::CustomContextMenu);
viewMenu->addAction("Edit");
viewMenu->popup(pos);
}
view = new QTableView();
connect(view, SIGNAL(customContextMenuRequested ( const QPoint &)), this, SLOT(viewMenu(const QPoint &)));
void MainWindow::viewMenu(const QPoint & pos)
{
QMenu *viewMenu = new QMenu("Edit Log", this);
viewMenu->setContextMenuPolicy(Qt::CustomContextMenu);
viewMenu->addAction("Edit");
viewMenu->popup(pos);
}
To copy to clipboard, switch view to plain text mode
viewMenu is declared as a slot.
so, what have I done wrong?
Bookmarks