chiaminhsu
8th February 2013, 15:09
Hi,
BrushColorAction is a QAction assigned a shortcut (Ctrl + C) and is added in a menu.
brushColorAction = new QAction(tr("&Brush Color..."), this);
brushColorAction->setShortcut(tr("Ctrl+C"));
connect(brushColorAction, SIGNAL(triggered()),
this, SLOT(brushColorAct()));
void brushColorAct() { .. QColorDialog * dlg = new QColorDialog; .... }
If I want to remove the menu but keep the shortcut (Ctrl + C) to invoke the color dialog,
how to do it ? Thank your replay.
BrushColorAction is a QAction assigned a shortcut (Ctrl + C) and is added in a menu.
brushColorAction = new QAction(tr("&Brush Color..."), this);
brushColorAction->setShortcut(tr("Ctrl+C"));
connect(brushColorAction, SIGNAL(triggered()),
this, SLOT(brushColorAct()));
void brushColorAct() { .. QColorDialog * dlg = new QColorDialog; .... }
If I want to remove the menu but keep the shortcut (Ctrl + C) to invoke the color dialog,
how to do it ? Thank your replay.