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

QGridLayout::addWidget() asserts when using negative rowSpan argument

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.3.5
    • Widgets: Layout
    • None

    Description

      The following example results in an assertion:

      QWidget w;
      QGridLayout *layout = new QGridLayout(&w);
      QPushButton *a = new QPushButton("A");
      QPushButton *b = new QPushButton("B");

      layout->addWidget(a, 0, 0);
      layout->addWidget(b, 1, 0, -1, 1);

      w.show();

      When built against a release version of Qt, it is possible to resize widget "w" so that push button "b" appears on top of push button "a".

      The assertion does not occur if a third widget is added to the grid layout:

      QWidget w;
      QGridLayout *layout = new QGridLayout(&w);
      QPushButton *a = new QPushButton("A");
      QPushButton *b = new QPushButton("B");
      QPushButton *c = new QPushButton("C");

      layout->addWidget(a, 0, 0);
      layout->addWidget(b, 1, 0, -1, 1);
      layout->addWidget(c, 2, 1);

      w.show();

      Update: A negative row span gives undefined results; this is clearly a bug in user code that is easy to work around. We will see if we can fix this but we cannot give it a high priority.

      Attachments

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

        Activity

          People

            smd Jan Arve
            sthomass Stian Sandvik Thomassen (closed Nokia identity) (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes