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

Add hiderow method to QFormLayout / space of hidden rows is still used

    XMLWordPrintable

Details

    • a74cdf778c (qt/qtbase/dev) a74cdf778c (qt/tqtc-qtbase/dev)

    Description

      QFormLayout allows a row consisting of a label and an editing widget to be added at the same time. There are instances where it would be convenient to be able to hide both the label and widget at the same time.

      It would be good to be able to do it by row number: hideRow( int row )

      or by the "field" widget: hideRow( QWidget field)

      Currently this can be done like this (assuming fld is the field widget and lay is the layout)

      fld.hide()
      lay.labelForField(fld).hide()

      One disadvantage of the above is that while the items in the row are hidden the spacing above and below the row remains, that is, the rows above and below the hidden row appear further spread apart than the rest of the items in the layout.

      A convenience method to hide the items and remove the spacing would be helpful.

      Thanks.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            vhilshei Volker Hilsheimer
            tweiler Todd Weiler
            Votes:
            47 Vote for this issue
            Watchers:
            40 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes