If I want to remove the menu but keep the shortcut (Ctrl + C) to invoke the color dialog,
how to do it ?
Don't add to QMenu, Just create the QAction, set the shortcut, and add the action to dialog
MyDialog * dialog = new MyDialog;
brushColorAction
= new QAction(tr
("&Brush Color..."), dialog
);
brushColorAction->setShortcut(tr("Ctrl+C"));
dialog->connect(brushColorAction, SIGNAL(triggered()), SLOT(brushColorAct()));
dialog->addAction(brushColorAction);
MyDialog * dialog = new MyDialog;
brushColorAction = new QAction(tr("&Brush Color..."), dialog);
brushColorAction->setShortcut(tr("Ctrl+C"));
dialog->connect(brushColorAction, SIGNAL(triggered()), SLOT(brushColorAct()));
dialog->addAction(brushColorAction);
To copy to clipboard, switch view to plain text mode
Bookmarks