globalsettingsdlg.cpp
来自「Linux下的C、C++ IDE」· C++ 代码 · 共 59 行
CPP
59 行
#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 + =
减小字号Ctrl + -
显示快捷键?