我的框架上有 2 个按钮,但是当我尝试添加第三个按钮时,QtCreator 停止工作。当我尝试添加另一个框架时,同样的事情发生了。这是我的代码示例。
QFrame *buttonFrame = new QFrame(this);
buttonFrame->setGeometry(930,900,750,100);
buttonFrame->setFrameShape(QFrame::StyledPanel);
QPushButton *nextbutton = new QPushButton(buttonFrame);
nextbutton->setText("Sonraki ");
nextbutton->setLayoutDirection(Qt::RightToLeft);
nextbutton->setMinimumSize(25,30);
QPushButton *downloadButton = new QPushButton(buttonFrame);
downloadButton->setText(" İndir");
downloadButton->setMinimumSize(25,30);
QPushButton *totalButton = new QPushButton(buttonFrame);
totalButton->setText("Tüm veriyi göster");
totalButton->setMinimumSize(25,40);
buttonLayout->addWidget(downloadButton,0,1);
buttonLayout->addWidget(nextbutton,0,2);
buttonLayout->addWidget(totalButton,0,3);
此代码在 totalButton 推荐时完美运行,但当我尝试将其添加到 buttonFrame QtCreator 中时停止工作。任何帮助将不胜感激。谢谢!