One possible way. The idea below is to use a widget as a menu item, so that the text property can be customized.
label->setStyleSheet("color: red");
newAct->setDefaultWidget(label);
newAct->setStatusTip(tr("Create a new file"));
connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
QWidgetAction *newAct = new QWidgetAction(this);
QLabel *label = new QLabel(tr("New"));
label->setStyleSheet("color: red");
newAct->setDefaultWidget(label);
newAct->setShortcuts(QKeySequence::New);
newAct->setStatusTip(tr("Create a new file"));
connect(newAct, SIGNAL(triggered()), this, SLOT(newFile()));
To copy to clipboard, switch view to plain text mode
Bookmarks