1 Star 0 Fork 0

Mrack/ MyShapez

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
ChooseScene.cpp 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
Mrack 提交于 2024-06-25 00:04 . 5555555555
#include "ChooseScene.h"
#include "config.h"
ChooseScene::ChooseScene()
{
ButtonSize = 160;
QPushButton *button[3] = {&choose_miner, &choose_belt, &choose_cutter};
QString style[] = {
"QPushButton{image: url(:/res/miner_button.png)}",
"QPushButton{image: url(:/res/belt_button.png)}",
"QPushButton{image: url(:/res/cutter_button.png)}"
};
for (int i = 0; i < 3; ++i)
{
button[i]->setParent(this);
button[i]->setFixedSize(ButtonSize, ButtonSize);
button[i]->setStyleSheet(style[i]);
}
}
void ChooseScene::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.setFont(QFont("楷体", 35, QFont::Bold));
painter.drawText(WidgetInfo::WIDGET_WIDTH / 2 - 530, (WidgetInfo::WIDGET_HEIGHT - ButtonSize) / 2 - 35, QString("恭喜通关!请选择希望在下一关升级速度的建筑:"));
QPushButton *button[3] = {&choose_miner, &choose_belt, &choose_cutter};
for (int i = 0; i < 3; ++i)
{
button[i]->move(180 * (i + 1) + ButtonSize * i, (WidgetInfo::WIDGET_HEIGHT - ButtonSize) / 2);
button[i]->show();
}
}
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/stucky/MyShapez-new.git
[email protected]:stucky/MyShapez-new.git
stucky
MyShapez-new
MyShapez
master

搜索帮助