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

Suggest new or modified layouts that handle heightForWidth better

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Unresolved
    • Not Evaluated
    • None
    • 5.12.4
    • Widgets: Layout
    • None
    • Qt5 for Linux, Android, or Windows.

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

        Activity

          People

            qt.team.quick.subscriptions Qt Quick and Widgets Team
            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