[C++] 纯文本查看 复制代码 int currentIndex = -1;
while(query.next())
{
currentIndex++;
ToolName = query.value(3).toString();
ToolUrl = query.value(5).toString();
StartExe = query.value(7).toString();
ToolPrompt = query.value(6).toString();
DowloadProgressButton *nBtn = new DowloadProgressButton(this);
//nBtn->setMaximumHeight(35);
nBtn->setFixedSize(80,80);
//QString btn_text = QString("Count%1").arg(ui->horizontalLayout_3->count());
nBtn->setProperty(ToolName
,ToolUrl
,tempDir
,ToolPrompt
,StartExe
,tempDir+"20230106193528.jpg"
,&networkManager);
//YJJCLayout 换为 QGirdLayout
int row = currentIndex / 10;
int col = currentIndex % 10;
ui->YJJCLayout->addWidget(nBtn, row, col);
}
看是不是你要的效果 |