📄 globalsettingsdlg.cpp
字号:
#include "globalsettingsdlg.h"#include "confmgr.h"#include <qpushbutton.h>#include <qlayout.h>#include <qhbox.h>#include <qlabel.h>GlobalSettingsDlg::GlobalSettingsDlg(QWidget *parent, const char *name) : QDialog(parent, name){ QVBoxLayout *vbox = new QVBoxLayout(this); vbox->setSpacing(5); QHBox *hbox = new QHBox(this); hbox->setMaximumWidth(200); m_cbOpenLastProj = new QCheckBox("Open Last Project on Startup", this); vbox->addWidget(m_cbOpenLastProj); GlobalConfMgr gcm; gcm.load(); m_cbOpenLastProj->setChecked(gcm.canOpenLastProj()); QPushButton *ok = new QPushButton("OK", hbox); ok->setDefault(true); QPushButton *cancel = new QPushButton("Cancel", hbox); QObject::connect(ok, SIGNAL(clicked()), this, SLOT(verify())); QObject::connect(cancel, SIGNAL(clicked()), this, SLOT(reject())); vbox->addWidget(hbox); setCaption("Global Settings");}int GlobalSettingsDlg::exec(){ return QDialog::exec();}void GlobalSettingsDlg::verify(){ GlobalConfMgr gcm; gcm.load(); gcm.setOpenLastProj(m_cbOpenLastProj->isChecked()); gcm.save(); accept();}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -