我是一名学生程序员,使用 Qt 为我的公司构建 GUI 界面。我目前正在构建一个读取器表,它读取数据并根据文件类型适当地分离它。任何人;when a certain file extension is selected I have a Message box display for selecting what type of data is in this file. 目前,消息框显示了从左到右堆叠的所有按钮,看起来有点愚蠢。我希望他们从上到下堆叠更好的 2x2 堆叠。我一直在查看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();
目前这个窗口看起来像这样:
所以知道你可以明白为什么我想在这里改变布局。感谢您阅读我的帖子!提前感谢您为克服这一挑战提供的任何帮助。