sajid
sajid

Reputation: 131

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?

Upvotes: 2

Views: 1953

Answers (1)

FrankH.
FrankH.

Reputation: 18217

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.

Upvotes: 7

Related Questions