Regarding context menu
I have created a Qwidget window on which i have place QTreeWidget.
Then i have created a context menu,& on right click of mouse i tried to show this context menu.
But I am not able to connect my signal to the slot.
The signal and the slot must have the same arguments, here you have QPoint and QContextMenuEvent types.
From the doc [doc.qt.nokia.com] : “The signals and slots mechanism is type safe: The signature of a signal must match the signature of the receiving slot.”
If your context menu is based on QAction, you just can set the contextMenuPolicy to Qt::ActionsContextMenu.
Then, all you need to do is insering your actions with QWidget::addAction [doc.qt.nokia.com]