#include "mainwindow.h"
#include "ui_mainwindow.h"
MainWindow::MainWindow(QWidget *parent)
: QMainWindow(parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
delete ui;
}
void MainWindow::on_pushButton_clicked()
{
int startY = 50 + buttonGroupCounter * (A * 30); // 设置一个基础的Y坐标来添加按钮
for (int i = 0; i < A; i++) {
QPushButton* btn = new QPushButton(this);
btn->setText(QString("按钮 %1").arg(i + 1));
btn->setGeometry(50, startY + i * 30, 100, 25);
btn->show();
buttonList.append(btn);
}
buttonGroupCounter++;
}
没有合适的资源?快使用搜索试试~ 我知道了~
qt1一1键生成1一组按钮
共6个文件
cpp:2个
h:1个
pro:1个
需积分: 1 0 下载量 74 浏览量
2023-09-15
07:45:10
上传
评论
收藏 5KB ZIP 举报
温馨提示
qt1一1键生成1一组按钮
资源推荐
资源详情
资源评论
收起资源包目录
qt一键生成1组按钮add22aSetofButtons230101.zip (6个子文件)
F:
add22aSetofButtons230101
add22aSetofButtons230101.pro 1021B
mainwindow.h 518B
mainwindow.cpp 714B
add22aSetofButtons230101.pro.user 22KB
main.cpp 217B
mainwindow.ui 1KB
共 6 条
- 1
资源评论
aw344
- 粉丝: 48
- 资源: 3
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功