资源简介
代码在qt5.0.1下可以正常运行 在头文件里面有完整的注释(参考用)图形文件在images下声音在sound文件下,代码里面也会体现出来 。
代码片段和文件信息
#include “customgamedialog.h“
customgamedialog::customgamedialog(QWidget *parent) :
QDialog(parent)
{
this->setWindowtitle(“自定义界面“);
QLabel *collabel = new QLabel(tr(“自定义列数: “));
QLabel *rowlabel = new QLabel(tr(“自定义行数: “));
QLabel *minenumlabel = new QLabel(tr(“自定义雷数: “));
rowspinbox = new QSpinBox(this);
rowspinbox->setSingleStep(1);
colspinbox = new QSpinBox(this);
colspinbox->setSingleStep(1);
minenumspinbox = new QSpinBox(this);
minenumspinbox->setSingleStep(1);
QPushButton *okbtn = new QPushButton(tr(“确定“)this);
this->connect(okbtnSIGNAL(clicked())thisSLOT(slot_acceptok()));
QPushButton *canecelbtn = new QPushButton(tr(“取消“)this);
this->connect(canecelbtnSIGNAL(clicked())thisSLOT(close()));
QHBoxLayout *hboxlayout = new QHBoxLayout;
hboxlayout->addStretch();
hboxlayout->addWidget(okbtn);
hboxlayout->addWidget(canecelbtn);
QGridLayout *glayout = new QGridLayout(this);
glayout->addWidget(rowlabel00);
glayout->addWidget(rowspinbox01);
glayout->addWidget(collabel10);
glayout->addWidget(colspinbox11);
glayout->addWidget(minenumlabel20);
glayout->addWidget(minenumspinbox21);
glayout->addLayout(hboxlayout3012);
this->readsettings();
}
void customgamedialog::readsettings()
{
QSettings settings(“szsq““MineSweep“);
settings.beginGroup(“CustomGame“);
int rownum = settings.value(“rownum“).toInt();
int colnum = settings.value(“colnum“).toInt();
int minenum = settings.value(“minenum“).toInt();
settings.endGroup();
rowspinbox->setValue(rownum);
colspinbox->setValue(colnum);
minenumspinbox->setValue(minenum);
}
void customgamedialog::writesettings()
{
QSettings settings(“szsq““MineSweep“);
settings.beginGroup(“CustomGame“);
settings.setValue(“rownum“rowspinbox->value());
settings.setValue(“colnum“colspinbox->value());
settings.setValue(“minenum“minenumspinbox->value());
settings.endGroup();
}
void customgamedialog::slot_acceptok()
{
int rownum = this->rowspinbox->value();
int colnum = this->colspinbox->value();
int minenum = this->minenumspinbox->value();
emit singal_sendCustomgamedialog(rownumcolnumminenum);
this->writesettings();
this->close();
}
相关资源
- 酒店管理系统基于Qt Creator5)
- oracle数据迁移项目实施方案
- CCS中如何生成LIB文件-并在另外CCS项目
- 农场开发项目
- vtk QT做的三维地质可视化系统2of2
- Qt局域网聊天软件
- Qt Creator opengl实现四元数鼠标控制轨迹
- QT局域网聊天系统(基于QT5.修改过)
- qt-电子点菜系统
- 完整的项目案例
- proteus_24C08—有注释(proteus里面使用的
- C 餐厅叫号系统(QT平)
- GIS项目开发文档(分析、设计、实现
- ARM嵌入式项目实战
- QT 实现文件下载
- qt图像处理
- 项目周报格式(excel格式报表)
- QT,JPEG解码源代码(已完成)
- 软件项目技术开发(委托)合同
- 软件工程文档模板1可行性研究报告
- 软件项目管理案例教程4
- 软件开发过程文档(开发大纲 编写规
- Qt 播放音频文件
- B2C商城综合系统项目源码
- oracle ebs 11i总帐、应收、应付、库存、
- Qt 读取16进制的data文件
- STM8S SX1278 项目和源代码
- 基于改进BSC的电信投资项目后评估体
- MQTT+串口(usart)透传
- 易语言QQTEA算法源码
评论
共有 条评论