简体   繁体   English

Qt布局和分离器的区别

[英]Qt layout and splitter difference

I want to ask that in Qt what is the difference between: 我想问一下Qt之间的区别是什么:

layout horizontally 水平布局

and: 和:

lay out horizontally in splitter 在分离器中水平放置

Similarly: 同理:

layout vertically 垂直布局

and: 和:

lay out vertically in splitter 在分离器中垂直布置

When should either be used? 什么时候应该使用?

Qt "Splitters" are layouts that give you a movable handle between the embedded frames, so that the user can adjust the relative size of each by dragging that. Qt“拆分器”是一种布局,可为您在嵌入式框架之间提供可移动的手柄,以便用户可以通过拖动来调整每个框架的相对大小。

You'd use a splitter instead of an ordinary layout if the ability to adjust the relative sizes of each is a reasonable user expectation; 如果能够合理调整用户的相对尺寸,则可以使用分割器而不是普通布局。 for example, the typical scenario would be a tree view to the left of your main window separated from the main viewport on the right, with the splitter handle allowing you do adjust how much you see of each. 例如,典型的情况是主窗口左侧的树状视图与右侧的主视口分开,并使用拆分器手柄调整每个视图的显示量。

An ordinary simple layout, on the other hand, would be used to implement something like a toolbar; 另一方面,普通的简单布局将用于实现工具栏之类的东西。 adjusting the relative sizes of toolbar buttons and/or having splitter handles in between toolbar buttons isn't "normal", therefore an ordinary layout is perfectly acceptable. 调整工具栏按钮的相对大小和/或在工具栏按钮之间使用分离器手柄不是“正常的”,因此普通布局是完全可以接受的。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM