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

UIC seems to be producing faulty code

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Not Evaluated
    • Resolution: Invalid
    • Affects Version/s: 5.3.1
    • Fix Version/s: None
    • Component/s: Build tools: uic
    • Labels:
      None
    • Environment:

      Description

      I've been trying to create a groupBox widget with a scrollArea using Qt Creator. Looking at the resultant generated ui_settings.h file (attached) I noticed that the scrollArea::setWidget is being applied to QWidget *scrollAreaWidgetContents

      scrollArea->setWidget(scrollAreaWidgetContents);

      whereas the items in the groupBox were actually being added to QWidget *layoutWidget2, created as

      layoutWidget2 = new QWidget(scrollAreaWidgetContents);

      If I modify the uic-generated ui_settings.h file to assign the scrollArea::setWidget to this layoutWidget2 instead of scrollAreaWidgetContents, then the scrollbars appear

      scrollArea->setWidget(layoutWidget2);

      I then looked at the ui file (settings.ui, attached) and noticed there was no layoutWidget2. So I did a make clean - cleaned everything out and did a manual uic on the ui file and saw the following warnings:

      settings.ui: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting to 'layoutWidget1'.
      settings.ui: Warning: The name 'layoutWidget' (QWidget) is already in use, defaulting to 'layoutWidget2'

      I was searching through through the bug reports using various keywords before writing up a new one. The closest one I found was QTCREATORBUG-7044 so I added notes there but decided to write up a new one.

        Attachments

        1. settings.ui
          5 kB
        2. ui_settings.h
          7 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

            Assignee:
            jkobus Jarek Kobus
            Reporter:
            lawlove Lawrence Love
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes