开发者

Qt layout and splitter difference

I want to ask that in Qt what is the difference between:

layout horizontally

and:

开发者_Go百科

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.

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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜