代码拉取完成,页面将自动刷新
#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();
}
}
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。