简体   繁体   中英

Qt layout and splitter difference

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

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.

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.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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