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

Qt UI Compiler run with "--no-implicit-includes" option continues to generate header files with #include directives

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • 5.9.1, 5.12.3, 5.13.1
    • Build tools: uic
    • None
    • Windows 10 x64
    • Linux/X11, Windows

    Description

      Qt UI Compiler (uic.exe) seems to ignore --no-implicit-includes (or -n) command line option. Despite the documented description of the option ("Don't generate any #include directives."), produced C++ header files still contain #includes to Qt classes used in .ui file.

      Example reproduction steps:

      1. Open cmd.
      2. Go to "%QTDIR%\..\..\..\Examples\Qt-5.12.3\qmake\precompile"
      3. Run "%QTDIR%\uic.exe --no-implicit-includes mydialog.ui"

      EXPECTED:
      Generated header file (printed in console) does not contain any #include directives.

      ACTUAL:
      Generated header file (printed in console) contains #include directives:

      /********************************************************************************
      ** Form generated from reading UI file 'mydialog.ui'
      **
      ** Created by: Qt User Interface Compiler version 5.12.3
      **
      ** WARNING! All changes made in this file will be lost when recompiling UI file!
      ********************************************************************************/
      
      #ifndef UI_MYDIALOG_H
      #define UI_MYDIALOG_H
      
      #include <QtCore/QVariant>
      #include <QtWidgets/QApplication>
      #include <QtWidgets/QDialog>
      #include <QtWidgets/QLabel>
      #include <QtWidgets/QPushButton>
      #include <QtWidgets/QVBoxLayout>
      
      QT_BEGIN_NAMESPACE
      
      class Ui_MyDialog
      {
      

      Attachments

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

        Activity

          People

            jkobus Jarek Kobus
            jacekc Jacek Czyrnek
            Votes:
            2 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes