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

uic creates global include for promoted widget class without obvious reason

    XMLWordPrintable

    Details

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

      Description

      After carefully inspecting the XML code, I am quite sure this is some sort of a bug. I have an UI file which promotes it's widgets to custom classes. This is done manually in QtDesigner and the relevant XML it produces looks like this:

      main.ui
       <customwidgets>
        <customwidget>
         <class>DataPoint</class>
         <extends>QWidget</extends>
         <header>../datapoint.h</header>
         <container>1</container>
        </customwidget>
        <customwidget>
         <class>DataPointForm</class>
         <extends>QWidget</extends>
         <header>../datapointform.h</header>
         <container>1</container>
        </customwidget>
       </customwidgets>
      

      But the C++ header code then looks like this:

      ui_main.h
      #include "../datapointform.h"
      #include <QtCore/QVariant>
      #include <QtWidgets/QAction>
      #include <QtWidgets/QApplication>
      #include <QtWidgets/QButtonGroup>
      #include <QtWidgets/QFormLayout>
      #include <QtWidgets/QHeaderView>
      #include <QtWidgets/QLabel>
      #include <QtWidgets/QMainWindow>
      #include <QtWidgets/QPushButton>
      #include <QtWidgets/QVBoxLayout>
      #include <QtWidgets/QWidget>
      #include "../datapoint.h"
      

      You can see that despite the fact both datapoint.h and datapointform.h are defined same way in the XML, they are included differently in C++.

      Unless uic has some sort of cache, this is a weird bug. I added both the input and output to the attachment for verification.

        Attachments

        1. main.ui
          7 kB
        2. ui_main.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:
            bugs everywhere MXXIV
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:

                Gerrit Reviews

                There are no open Gerrit changes