Monday, August 26, 2013
Tutorial: Adjustable UI with QSplitters
Monterey version 3.0 now has an adjustable UI! Not only is the window itself able to be scaled, but now you can apportion the UI how you'd like. If you want, you can make the graphs taller or shorter (even hide them), and you can adjust the widths of both side panels. Upon closing, Monterey saves your window geometry so when you open it again, the UI is setup the way you like.
Here are the relevant pieces of code:
As you can see, it's all pretty simple and easy to do. The default values are set using QSplitter::setStretchFactor(int index, int value), which uses the relative weight of each stretch factor to adjust the sizes.
Thanks for stopping by,