waynew
10th January 2010, 03:01
Right click on the view, nothing happens, here's the code:
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);
}
viewMenu is declared as a slot.
so, what have I done wrong?
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);
}
viewMenu is declared as a slot.
so, what have I done wrong?