Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Qt VS Tools, how to configure moc'ing



  • Hi folks!
    I'm working on a VS 2017 project, after importing a .pri file, when I watch into the .proj I find this really nice piece of XML

    <QtMoc Include="base\starter1.hpp">
          <ForceInclude Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">stdfax.h;$(ProjectDir)ui/%(Filename)%(Extension)</ForceInclude>
          <ForceInclude Condition="'$(Configuration)|$(Platform)'=='Release|x64'">stdfax.h;$(ProjectDir)ui/%(Filename)%(Extension)</ForceInclude>
    </QtMoc>
    

    Instead when I add a single file (right click on the project) I get all this NOT really useful stuff...

    <QtMoc Include="base\Test.hpp">
          <OutputFile Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.\GeneratedFiles\moc_%(Filename).cpp</OutputFile>
          <IncludePath Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">.;.\base;.\..\libs\include;.\..\libs\zlib;$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtPrintSupport;$(QTDIR)\include\QtQml;$(QTDIR)\include\QtQuick;$(QTDIR)\include\QtQuickWidgets;$(QTDIR)\include\QtQuickControls2;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtUiTools;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtTest;.\GeneratedFiles;.\GeneratedFiles\moc\;</IncludePath>
          <Define Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">UNICODE;QT_AXSERVER_LIB;QT_CORE_LIB;QT_GUI_LIB;QT_HELP_LIB;QT_NETWORK_LIB;QT_PRINTSUPPORT_LIB;QT_QML_LIB;QT_QUICK_LIB;QT_QUICKWIDGETS_LIB;QT_QUICKCONTROLS2_LIB;QT_SVG_LIB;QT_UITOOLS_LIB;QT_WIDGETS_LIB;QT_TESTLIB_LIB;QT_NO_DEBUG;NDEBUG</Define>
          <OutputFile Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.\GeneratedFiles\moc_%(Filename).cpp</OutputFile>
          <IncludePath Condition="'$(Configuration)|$(Platform)'=='Release|x64'">.;.\base;.\..\libs\include;.\..\libs\zlib;$(QTDIR)\include;$(QTDIR)\include\QtCore;$(QTDIR)\include\QtGui;$(QTDIR)\include\QtANGLE;$(QTDIR)\include\QtNetwork;$(QTDIR)\include\QtPrintSupport;$(QTDIR)\include\QtQml;$(QTDIR)\include\QtQuick;$(QTDIR)\include\QtQuickWidgets;$(QTDIR)\include\QtQuickControls2;$(QTDIR)\include\QtSvg;$(QTDIR)\include\QtUiTools;$(QTDIR)\include\QtWidgets;$(QTDIR)\include\QtTest;.\GeneratedFiles;.\GeneratedFiles\moc\;</IncludePath>
        </QtMoc>
    

    Does somebody know how to configure Qt VS Tools in order to always use the first settings?


Log in to reply