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. basewidget.cpp
          2 kB
          Rudolf Cardinal
        2. basewidget.h
          2 kB
          Rudolf Cardinal
        3. boxlayouthfw.cpp
          56 kB
          Rudolf Cardinal
        4. boxlayouthfw.h
          10 kB
          Rudolf Cardinal
        5. flowlayouthfw.cpp
          15 kB
          Rudolf Cardinal
        6. flowlayouthfw.h
          5 kB
          Rudolf Cardinal
        7. gridlayouthfw.cpp
          60 kB
          Rudolf Cardinal
        8. gridlayouthfw.h
          8 kB
          Rudolf Cardinal
        9. gui_defines.h
          5 kB
          Rudolf Cardinal
        10. hboxlayouthfw.cpp
          0.9 kB
          Rudolf Cardinal
        11. hboxlayouthfw.h
          1 kB
          Rudolf Cardinal
        12. labelwordwrapwide.cpp
          16 kB
          Rudolf Cardinal
        13. labelwordwrapwide.h
          4 kB
          Rudolf Cardinal
        14. layouts.h
          1 kB
          Rudolf Cardinal
        15. margins.cpp
          7 kB
          Rudolf Cardinal
        16. margins.h
          5 kB
          Rudolf Cardinal
        17. qtlayouthelpers.cpp
          27 kB
          Rudolf Cardinal
        18. qtlayouthelpers.h
          8 kB
          Rudolf Cardinal
        19. sizehelpers.cpp
          9 kB
          Rudolf Cardinal
        20. sizehelpers.h
          6 kB
          Rudolf Cardinal
        21. vboxlayouthfw.cpp
          0.9 kB
          Rudolf Cardinal
        22. vboxlayouthfw.h
          1 kB
          Rudolf Cardinal
        23. verticalscrollarea.cpp
          34 kB
          Rudolf Cardinal
        24. verticalscrollarea.h
          3 kB
          Rudolf Cardinal
        25. verticalscrollareaviewport.cpp
          3 kB
          Rudolf Cardinal
        26. verticalscrollareaviewport.h
          2 kB
          Rudolf Cardinal
        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