添加小部件时 QtCreator 停止工作
QtCreator stopped working when a widget added
我的框架上本来就有 2 个按钮,但是当我尝试添加第 3 个按钮时,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 commend out 时,此代码完美运行,但当我尝试将其添加到 buttonFrame 中时,QtCreator 停止工作。任何帮助将不胜感激。谢谢!
我的主要 window 正在初始化我之前给出的固定大小。当我删除固定大小功能并初始化 main window 默认大小时,问题就解决了。希望对遇到同样问题的人有所帮助。
我的框架上本来就有 2 个按钮,但是当我尝试添加第 3 个按钮时,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 commend out 时,此代码完美运行,但当我尝试将其添加到 buttonFrame 中时,QtCreator 停止工作。任何帮助将不胜感激。谢谢!
我的主要 window 正在初始化我之前给出的固定大小。当我删除固定大小功能并初始化 main window 默认大小时,问题就解决了。希望对遇到同样问题的人有所帮助。