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

QLayout has sticking constraint values

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 6.10
    • Widgets: Layout
    • None

    Description

      Widgets can retain old minimum and maximum size constraints. Setting a new size constraint will not remove minimum and maximum values from another one.
      The qlayout.cpp has mentions regarding that and an example can be tst_qlayout.cpp

              void clearConstraintAndResize(QSize sz, Qt::Orientations o = Qt::Horizontal | Qt::Vertical)
              {
                  if (o == (Qt::Horizontal | Qt::Vertical))
                      setSizeConstraint(QLayout::SizeConstraint::SetNoConstraint);
                  else if (o == Qt::Vertical)
                      setVerticalSizeConstraint(QLayout::SizeConstraint::SetNoConstraint);
                  else if (o == Qt::Horizontal)
                      setHorizontalSizeConstraint(QLayout::SizeConstraint::SetNoConstraint);                         parentWidget()->setMinimumSize(0, 0); // <== ***** Should NOT be needed ****
                  parentWidget()->setMaximumSize(QWIDGETSIZE_MAX, QWIDGETSIZE_MAX);
                  parentWidget()->resize(sz);
                  activate();
              }
       

       

       

      Attachments

        For Gerrit Dashboard: QTBUG-137093
        # Subject Branch Project Status CR V

        Activity

          People

            tmartsum Thorbjørn Lund Martsum
            tmartsum Thorbjørn Lund Martsum
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There is 1 open Gerrit change