title: Moving from QT 5.12.8 to 5.15.2 MOC fails
body: <p>We try to mov to the latest Qt 5 LTSB (5.15.2) from our working base Qt 5.12.8 but ran into MOC errors:<br/>
  The moc process failed to compile<br/>
     &quot;SRC:GenericForm.h&quot;<br/>
  into<br/>
     &quot;SRC:moc_GenericForm.cpp&quot;<br/>
  Output<br/>
     SRC:/workspace/NBCI2/src/base/base_language.(9): Parse error at &quot;{&quot;</p>
  <p>The problem occours whith every Qt build greater 5.12.x what do we missing? What is changed on moc between 5.12.x and later?<br/>
  Build system is cmake<br/>
  base_language is include by some of the include headers.<br/><br/>
  GenericForm.h:</p>
  <pre><code>#pragma once
  
  #include &quot;host.h&quot;
  #include &quot;qt_type_defines.h&quot;
  #include &lt;qwidget.h&gt;
  #include &quot;qt_in_scheduler.h&quot;
  #include &quot;qt_out_scheduler.h&quot;
  #include &quot;GenericBaseForm.h&quot;
  
  namespace qt
  {
      using namespace nbc;
      class GenericForm : public GenericBaseForm
      {
          Q_OBJECT
      public:
          GenericForm(host::ihost * h, const GenericFormConfig &amp; cfg, safe_bool &amp; Shutdown, rmutex &amp; form_creation_mtx);
          virtual ~GenericForm();
          virtual void SetTitleError(bool on);
          virtual void SetTitle(str_cref title_str);
          virtual void SetHintText(str_cref hint_str);
          virtual bool AllowHide();
          virtual void OnLanguageChange(lang_t)
      };
  }
  </code></pre>
  <p>base_language:</p>
  <pre><code>#ifndef BASE_LANGAUAGE_H
  #define BASE_LANGAUAGE_H
  
  #include &quot;base.h&quot;
  
  namespace base
  {
      enum struct lang_t : char
      {
          default = -1,
          english = 0, 
          german = 1, 
          french = 2,
      };
  
      base::str_t to_string(lang_t);
      lang_t from_string(base::str_cref);
  }
  #endif
  </code></pre>
  <p>CMake.txt:</p>
  <pre><code>CMAKE_MINIMUM_REQUIRED(VERSION 3.17.0 FATAL_ERROR)
  
  SET(VERSION_MAJOR 1)
  SET(VERSION_MINOR 0)
  SET(VERSION_PATCH 0)
  
  SET(PROJECT_NAME &quot;lib_GenericForms&quot;)
  
  # find Qt5 and required components
  FIND_PACKAGE(Qt5 COMPONENTS REQUIRED Core Gui Widgets )
  
  #need this to include the auto generated ui_mainwindow.h
  #file from the qt5_wrap_ui call below.
  IF(CMAKE_VERSION VERSION_LESS &quot;3.7.0&quot;)
      SET(CMAKE_INCLUDE_CURRENT_DIR ON)
  ENDIF()
  
  INCLUDE_DIRECTORIES( 
  )
  
  ADD_DEFINITIONS(  -DBUILD_STATIC -DQT_SUPPORT_LIB
  )
  
  SET(CMAKE_AUTOMOC ON)
  SET(CMAKE_AUTOUIC ON)
  SET(CMAKE_AUTORCC ON)
  
  SET(ENVIRONMENT_EXTENSION_DEBUG
      ${ENVIRONMENT_EXTENSION}
  )   
  
  SET(ENVIRONMENT_EXTENSION_RELEASE
      ${ENVIRONMENT_EXTENSION}
  )
  
  #set project sources
  SET(PROJECT_SOURCES    
      ${CMAKE_CURRENT_LIST_DIR}/GenericBaseForm.h
      ${CMAKE_CURRENT_LIST_DIR}/GenericBaseForm.cpp
      ${CMAKE_CURRENT_LIST_DIR}/GenericForm.h
      ${CMAKE_CURRENT_LIST_DIR}/GenericForm.cpp
      ${CMAKE_CURRENT_LIST_DIR}/GenericSensorForm.h
      ${CMAKE_CURRENT_LIST_DIR}/GenericSensorForm.cpp
  )
  
  SET(PROJECT_RESOURCES
  )
  
  #set project sources
  SET(PROJECT_UI
  )
  
  # setup project
  ADD_LIBRARY(${PROJECT_NAME} STATIC
      ${PROJECT_SOURCES}
      ${UI_WRAP}
      ${MOC_SOURCES}
  )
  
  TARGET_LINK_LIBRARIES(
      ${PROJECT_NAME}
      PUBLIC
      Qt5::Core
      Qt5::Gui
      Qt5::Widgets
  )
  
  GenerateVSUserFile(
      &quot;${ENVIRONMENT_EXTENSION_DEBUG}&quot;
      &quot;${ENVIRONMENT_EXTENSION_RELEASE}&quot;
      &quot;$(TargetDir)&quot;
      &quot;$(TargetDir)&quot;
      &quot;$(TargetPath)&quot;
      &quot;$(TargetPath)&quot;
      &quot;&quot;
      &quot;&quot;
      &quot;${PROJECT_NAME}&quot;
  )
  
  GenerateVersionInfo(
      1
      0
      0
      &quot;${PROJECT_NAME}&quot;
      &quot;${PROJECT_NAME}&quot;
      &quot;${PROJECT_NAME}.lib&quot;
      &quot;${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.rc&quot;
      &quot;${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}_version.h&quot;
  )
  
  # Executables fail to build with Qt 5 in the default configuration
  # without -fPIE. We add that here.
  set(CMAKE_CXX_FLAGS &quot;${Qt5Widgets_EXECUTABLE_COMPILE_FLAGS}&quot;)
  
  #Set the target link subsystem
  SET(CMAKE_EXE_LINKER_FLAGS &quot;${CMAKE_EXE_LINKER_FLAGS} /SUBSYSTEM:WINDOWS&quot;)
  
  #set compiler flasgs
  SET(COMPILER_FLAGS &quot;${COMPILER_FLAGS} /MP&quot;)
  SET(COMPILER_FLAGS &quot;${COMPILER_FLAGS} /EHsc&quot;)
  SET(COMPILER_FLAGS &quot;${COMPILER_FLAGS} /Zc:wchar_t&quot;)
  SET(COMPILER_FLAGS &quot;${COMPILER_FLAGS} /wd4290&quot;)
  SET_TARGET_PROPERTIES(${PROJECT_NAME} PROPERTIES COMPILE_FLAGS &quot;${COMPILER_FLAGS}&quot;)
  
  SET(PROJECT_NAME_INCLUDES ${CMAKE_CURRENT_LIST_DIR} PARENT_SCOPE)
  SET(PROJECT_NAME_PROJECTNAME &quot;${PROJECT_NAME}&quot; PARENT_SCOPE)
  </code></pre>