You forgot to adjust frmSettings::ProvideContexMenu(). It still takes a pointer.

The easiest way to construct a context menu is to use Qt::ActionsContextMenu. All it takes is to add actions via QWidget::addAction() and the menu is constructed automatically for you:
Qt Code:
  1. setContextMenuPolicy(Qt::ActionsContextMenu);
  2. QAction* fooAction = new new QAction("foo");
  3. QAction* barAction = new new QAction("bar");
  4. connect(fooAction, SIGNAL(triggered()), this, SLOT(doSomethingFoo()));
  5. connect(barAction, SIGNAL(triggered()), this, SLOT(doSomethingBar()));
  6. addAction(fooAction);
  7. addAction(barAction);
To copy to clipboard, switch view to plain text mode