How to detect a "right cilck" on a QToolBar?
-
Hi,
Have tried doing as following:
@void xxx::onRightClick()
{
QPopupMenu* contextMenu = new QPopupMenu ( this );
Q_CHECK_PTR ( contextMenu );contextMenu->insertItem ( "Copy" , this , SLOT (Copy()) );
contextMenu->exec ( QCursor::pos() );
delete contextMenu;
contextMenu = 0;
}@ -
Hi,
You can either subclass QToolBar and reimplement mousePressEvent or use an event filter, see this "document":http://qt-project.org/doc/qt-5.0/qtcore/eventsandfilters.html