📄 fontoption.cc
字号:
/** @file FontOption - class for widget containing one editable string setting, while allowing to either type (allowing things like copy/paste) the font description (name), or use dialog to pick it. User's choice @author Martin Petricek*/#include "fontoption.h"#include <QString>#include <QFontDialog>namespace gui {/** Default constructor of FontOption item @param parent parent Option Editor containing this control @param _key Key in settings for this option @param defValue Default value if option not found in configuration */FontOption::FontOption(const QString &_key/*=0*/,QWidget *parent/*=0*/,const QString &defValue/*=0*/) : DialogOption (_key,parent,defValue) {}//See DialogOption for description of this abstract methodvoid FontOption::dialog(QString &value) { QFont initial; initial.fromString(value); bool ok; QFont ret=QFontDialog::getFont(&ok,initial,this); if (ok) { //Some font picked // font is set to the font the user selected value=ret.toString(); }}/** default destructor */FontOption::~FontOption() {}} // namespace gui
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -