Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Restricted Layout for Qt GUI applications



  • Hi again!!!

    Restricted Layout is a GridLayout in which the internal widgets meet a set of size requirements. When some widgets can not be shown due to size restrictions, two flow-control buttons appear to allow us to show hidden ones. Those size requirements can be changed in runtime.

    You can see it working here: "http://www.youtube.com/watch?v=VfM6HpHy6X4":http://www.youtube.com/watch?v=VfM6HpHy6X4

    This layout could be very useful in scenarios in which a set of panels are shown, but there are some size restrictions to be met in order to ensure visualization quality (usually a minimum width and height values).

    Comments, suggestions, and impressions are welcome.
    Enjoy it!!!



  • video is missing... :(



  • [quote author="paulo" date="1293128940"]video is missing... :([/quote]

    Now it is available (it was just uploaded in YouTube ;-)



  • great, nice work



  • good demo.



  • Yes, it is really interesting, I already think about how I could utilize such a feature.



  • Good job!

    When can we expect the release of both QAutomaticLayout and Restricted Layouts?



  • Wow Great work, Can we have some src code of it? I am specially interested modifying size at run time



  • [quote author="Immii" date="1293233099"]Wow Great work, Can we have some src code of it? I am specially interested modifying size at run time[/quote]

    Hi Immii!!!

    I can not release the source code yet, but let me give you some advices:

    • you can use a QGridLayout with a fixed size. It is the container in which include your widgets.
    • use a collection of widgets: for the widgets you can show, visible = true, and visible = false for the opposite situation.
    • distribute the visible widgets along the slots in the layout

    Cheers!!!



  • Nice demo. I like it. I am not sure I like the bottons above and under the view that much though. Is that hard-coded?



  • [quote author="Andre" date="1295000613"]Nice demo. I like it. I am not sure I like the bottons above and under the view that much though. Is that hard-coded? [/quote]

    Hi Andre,

    those buttons are automatically shown when some QWidget included into the RestrictedLayout have to be hidden because size restrictions are not met.

    Could you suggest me other way to provide access to hidden components? It would be very helpful for me.

    Thank you very much for your valuable feedback.



  • The best way to do that, would be application dependant, I think. For one application, the best solution could be to provice previous and next buttons under the layout you show. For others, gestures may be appropriate, and in the next one, you'd like to have scroll bars.

    In short, I think there should be API to enable custom navigation of the restricted layout. That way, users can make up their own mind on what means of navigation suits their application.


Log in to reply