我是一位使用Qt为我的公司构建GUI界面的学生程序员。我目前正在构建一个阅读器表格,该表格读取数据并根据文件类型对其进行适当的分离。 Anywho;当选择某个文件扩展名时,我有一个消息框显示来选择该文件中的数据类型。目前消息框显示了从左到右堆叠的所有按钮,看起来有点笨。我希望他们能够从顶部到底部堆栈2x2。我一直在寻找QMessageBox documentation,似乎找不到一种方法来做到这一点。我知道一个人必须存在似乎我只是需要一些帮助找到它。目前我的这个消息框的鳕鱼看起来像这样;QMessageBox;按钮布局
QMessageBox templateSelectorWindow;
QPushButton * pressureBC =templateSelectorWindow.addButton("Pressure Boundry Condition", QMessageBox::AcceptRole);
QPushButton * flowBC = templateSelectorWindow.addButton("Flow Boundry Condition", QMessageBox::AcceptRole);
QPushButton * massFlowBC = templateSelectorWindow.addButton("Mass Flow Boundry Condition", QMessageBox::AcceptRole);
QPushButton * thermalWallBC = templateSelectorWindow.addButton("Thermal Wall Boundry Condition", QMessageBox::AcceptRole);
QPushButton * cancelButton = overwriteWarning.addButton("Cancel", QMessageBox::RejectRole);
templateSelectorWindow.setWindowTitle("Input File Type");
templateSelectorWindow.setText("Input Files Require You Select The Input File Type:");
templateSelectorWindow.setInformativeText("Please select the the input type from the following");
templateSelectorWindow.exec();
目前这个窗口看起来是这样的:
所以知道你可以看到为什么我想在这里改变布局。感谢您阅读我的文章!预先感谢您为克服这一挑战做出的贡献。