Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-77625

Suggest new or modified layouts that handle heightForWidth better

    XMLWordPrintable

    Details

    • Type: Suggestion
    • Status: Reported
    • Priority: Not Evaluated
    • Resolution: Unresolved
    • Affects Version/s: 5.12.4
    • Fix Version/s: None
    • Component/s: Widgets: Layout
    • Labels:
      None
    • Environment:

      Qt5 for Linux, Android, or Windows.

    • Platform/s:
      All

      Description

      Thanks as ever for Qt, which is excellent. Further to the Qt6 blog post and request for suggestions:

      In Qt 5 I have found it hard to (a) create labels that word-wrap their text, and (b) prefer to be wide rather than tall, and (c) are handled gracefully by Qt layouts such as QVBoxLayout, QHBoxLayout, QGridLayout, and FlowLayout, such that parents resize appropriately for their children.

      Previous discussion is at https://stackoverflow.com/questions/14238138/heightforwidth-label , which remains relevant.

      I'd like to suggest it for Qt6. This is operational and suggested code is at https://github.com/RudolfCardinal/camcops/tree/master/tablet_qt

      ... specifically,

      • common/gui_defines.h
      • lib/margins.*
      • lib/sizehelpers.*
      • layouts/*
      • widgets/basewidget.*
      • widgets/labelwordwrapwide.*
      • widgets/verticalscrollarea.*

      (also attached).

      all the best,

      Rudolf Cardinal.

       

        Attachments

        1. basewidget.cpp
          2 kB
        2. basewidget.h
          2 kB
        3. boxlayouthfw.cpp
          56 kB
        4. boxlayouthfw.h
          10 kB
        5. flowlayouthfw.cpp
          15 kB
        6. flowlayouthfw.h
          5 kB
        7. gridlayouthfw.cpp
          60 kB
        8. gridlayouthfw.h
          8 kB
        9. gui_defines.h
          5 kB
        10. hboxlayouthfw.cpp
          0.9 kB
        11. hboxlayouthfw.h
          1 kB
        12. labelwordwrapwide.cpp
          16 kB
        13. labelwordwrapwide.h
          4 kB
        14. layouts.h
          1 kB
        15. margins.cpp
          7 kB
        16. margins.h
          5 kB
        17. qtlayouthelpers.cpp
          27 kB
        18. qtlayouthelpers.h
          8 kB
        19. sizehelpers.cpp
          9 kB
        20. sizehelpers.h
          6 kB
        21. vboxlayouthfw.cpp
          0.9 kB
        22. vboxlayouthfw.h
          1 kB
        23. verticalscrollarea.cpp
          34 kB
        24. verticalscrollarea.h
          3 kB
        25. verticalscrollareaviewport.cpp
          3 kB
        26. verticalscrollareaviewport.h
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            qt.team.quick.subscriptions Qt Quick and Widgets Team
            Reporter:
            rudolf@pobox.com Rudolf Cardinal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:

                Gerrit Reviews

                There are no open Gerrit changes