📄 menuaction.cc
字号:
/** @file MenuAction - wrapper around QAction @author Martin Petricek*/#include "menuaction.h"namespace gui {/** Constructor of MenuAction @param parent Parent object*/MenuAction::MenuAction(QObject *parent) : QAction(parent) { init();}/** Constructor of MenuAction @param text Item text @param parent Parent object*/MenuAction::MenuAction(const QString &text, QObject *parent) : QAction(text,parent) { init();}/** Constructor of MenuAction @param icon Item icon @param text Item text @param parent Parent object*/MenuAction::MenuAction(const QIcon &icon, const QString &text, QObject *parent) : QAction(icon,text,parent) { init();}/** Common initialization function*/void MenuAction::init() { connect(this,SIGNAL(triggered(bool)),this,SLOT(internal_triggered(bool))); connect(this,SIGNAL(hovered()),this,SLOT(internal_hovered()));}/** Internal slot, used to re-emit the signal @param checked True if this was a checkitem and it is checked*/void MenuAction::internal_triggered(bool checked/*=false*/) { emit triggered(this);}/** Internal slot, emit help text when hovered over the item*/void MenuAction::internal_hovered() { QString s=text().replace("&",""); QKeySequence sq=shortcut(); if (!sq.isEmpty()) { s+=QString(" (")+sq.toString(QKeySequence::NativeText)+QString(")"); } emit helpText(s);}} // namespace gui
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -