如果你想在layout中添加两个水平布局,请尝试以下代码修改:
QHBoxLayout* horizontalLayout1 = new QHBoxLayout();
QHBoxLayout* horizontalLayout2 = new QHBoxLayout();
layout->addLayout(horizontalLayout1);
layout->addWidget(scrollArea);
layout->addLayout(horizontalLayout2);
这样就在layout中分别添加了horizontalLayout1和horizontalLayout2两个水平布局,且在滚动区域 scrollArea 前后。你可以根据需要将相应的控件放置到对应的水平布局中。记得按照你的要求设置每个布局的样式和边距等属性。
内容由零声教学AI助手提供,问题来源于学员提问




