title: Qt4 / C++ / CMake - no appropriate default constructor available
body: <p>I'm using Qt Creator 3.1.2/Qt4.8.6 and CMake3.0.0. Note that I'm using SceniX API if you're concerned about my CMakeLists.txt but that doesn't affect this. However, when compiling a UI generated by Qt Creator I get the following error:</p>
  
  <pre><code>D:\Projects\C Projects\MyProjectName\ui\masterui.cpp:6: error: C2512: 'Ui::MasterUI' : no appropriate default constructor available
  </code></pre>
  
  <p>However, the default constructor IS available. These are default files generated by Qt Creator and setup for use in CMake. They might be slightly modified while experimenting but they have never worked.</p>
  
  <p>I will share my masterui.h / masterui.cpp / CMakeLists.txt in that order.</p>
  
  <p><strong>masterui.h</strong></p>
  
  <pre><code>#ifndef MASTERUI_H
  #define MASTERUI_H
  
  #include &lt;QWidget&gt;
  
  namespace Ui {
  class MasterUI;
  }
  
  class MasterUI : public QWidget
  {
      Q_OBJECT
  
  public:
      explicit MasterUI(QWidget *parent = 0);
      ~MasterUI();
  
  private:
      Ui::MasterUI *ui;
  };
  
  #endif // MASTERUI_H
  </code></pre>
  
  <p><strong>masterui.cpp</strong></p>
  
  <pre><code>#include "masterui.h"
  #include "ui_masterui.h"
  
  MasterUI::MasterUI(QWidget *parent) :
      QWidget(parent),
      ui(new Ui::MasterUI)
  {
      ui-&gt;setupUi(this);
  }
  
  MasterUI::~MasterUI()
  {
      delete ui;
  }
  </code></pre>
  
  <p><strong>CMakeLists.txt</strong></p>
  
  <pre><code>cmake_minimum_required(VERSION 2.6)
  
  project(MyProjectName)
  
  file(TO_CMAKE_PATH $ENV{SCENIXHOME} SCENIX_HOME)
  set(CMAKE_MODULE_PATH "${SCENIX_HOME}/CMake")
  set(CMAKE_RUNTIME_OUTPUT_DIRECTORY "../exe/MyProjectName_exe")
  set(CMAKE_LIBRARY_OUTPUT_DIRECTORY "../exe/MyProjectName_exe")
  
  file(GLOB sources
          "src/*.cpp")
  
  file(GLOB headers
          "inc/*.h")
  
  find_package(OpenGL REQUIRED)
  find_package(SceniX REQUIRED)
  find_package(NVQt4 QUIET)
  find_package(Qt4 REQUIRED)
  
  set( QT_USE_QTOPENGL TRUE )
  include( ${QT_USE_FILE} )
  
  SCENIX_SET_BINARY_FOLDERS()
  
  QT4_ADD_RESOURCES(QTResources)
  
  QT4_WRAP_UI(UIsrc "ui/masterui.ui")
  QT4_WRAP_CPP(MOCsrc "ui/masterui.h")
  ADD_EXECUTABLE(UIexe "src/main.cpp" "ui/masterui.cpp" ${MOCsrc} ${UIsrc})
  file( GLOB UICsources
          "${CMAKE_CURRENT_BINARY_DIR}/*.h")
  set( UIC_SOURCES "${UICsources}")
  
  set( SCENIX_COMMON_BASE "${SCENIX_HOME}/samples/common" )
  
  file( GLOB uisources
        "${SCENIX_COMMON_BASE}/src/ui/*.cpp" )
  
  set( UI_SOURCES "${uisources}" )
  
  set( MyProjectName_SOURCES
    ${sources}
    ${SCENIX_COMMON_BASE}/src/SimpleScene.cpp
    ${SCENIX_COMMON_BASE}/src/MeshGenerator.cpp
    ${SCENIX_COMMON_BASE}/src/SceneFunctions.cpp
    ${SCENIX_COMMON_BASE}/src/SceniXWidget.cpp
    ${SCENIX_COMMON_BASE}/Qt4/src/SceniXQGLContext.cpp
    ${SCENIX_COMMON_BASE}/Qt4/src/SceniXQGLWidget.cpp
    ${SCENIX_COMMON_BASE}/Qt4/src/SceniXQGLSceneRendererWidget.cpp
    ${UI_SOURCES}
    ${UIC_SOURCES}
    ${QTResources}
    ${UICsources}
  )
  
  set ( MyProjectName_HEADERS
    ${headers}
    ${SCENIX_COMMON_BASE}/inc/SimpleScene.h
    ${SCENIX_COMMON_BASE}/inc/MeshGenerator.h
    ${SCENIX_COMMON_BASE}/inc/SceneFunctions.h
    ${SCENIX_COMMON_BASE}/inc/SceniXWidget.h
    ${SCENIX_COMMON_BASE}/Qt4/inc/SceniXQGLContext.h
    ${SCENIX_COMMON_BASE}/Qt4/inc/SceniXQGLWidget.h
    ${SCENIX_COMMON_BASE}/Qt4/inc/SceniXQGLSceneRendererWidget.h
  )
  
  include_directories( ${SCENIX_INCLUDES} )
  include_directories( ${SCENIXRT_INCLUDES} )
  include_directories( "." )
  include_directories( "inc" )
  include_directories( "${SCENIX_COMMON_BASE}/inc" )
  include_directories( "${SCENIX_COMMON_BASE}/Qt4/inc" )
  include_directories( "${CMAKE_CURRENT_BINARY_DIR}" )
  
  add_executable( MyProjectName
    ${MyProjectName_SOURCES}
    ${MyProjectName_HEADERS}
  )
  
  target_link_libraries( MyProjectName
    ${QT_LIBRARIES}
    ${SCENIX_LIBS}
    ${SCENIXRT_LIBS}
    ${OPENGL_gl_LIBRARY}
    ${QT_QTMAIN_LIBRARY}
  )
  
  
  if(TARGET SceniX)
    add_dependencies( MyProjectName SceniX SceniXRT )
    add_perforce_to_target( MyProjectName )
  endif()
  
  set_target_properties( MyProjectName PROPERTIES FOLDER "Samples")
  </code></pre>
  
  <hr>
  
  <p><strong>ui_masterui.h</strong></p>
  
  <pre><code>/********************************************************************************
  ** Form generated from reading UI file 'masterui.ui'
  **
  ** Created by: Qt User Interface Compiler version 4.8.6
  **
  ** WARNING! All changes made in this file will be lost when recompiling UI file!
  ********************************************************************************/
  
  #ifndef UI_MASTERUI_H
  #define UI_MASTERUI_H
  
  #include &lt;QtCore/QVariant&gt;
  #include &lt;QtGui/QAction&gt;
  #include &lt;QtGui/QApplication&gt;
  #include &lt;QtGui/QButtonGroup&gt;
  #include &lt;QtGui/QHeaderView&gt;
  #include &lt;QtGui/QWidget&gt;
  
  QT_BEGIN_NAMESPACE
  
  class Ui_masterWidget
  {
  public:
  
      void setupUi(QWidget *masterWidget)
      {
          if (masterWidget-&gt;objectName().isEmpty())
              masterWidget-&gt;setObjectName(QString::fromUtf8("masterWidget"));
          masterWidget-&gt;resize(640, 360);
          masterWidget-&gt;setStyleSheet(QString::fromUtf8("background-color: rgb(71, 71, 71);"));
  
          retranslateUi(masterWidget);
  
          QMetaObject::connectSlotsByName(masterWidget);
      } // setupUi
  
      void retranslateUi(QWidget *masterWidget)
      {
          masterWidget-&gt;setWindowTitle(QApplication::translate("masterWidget", "Form", 0, QApplication::UnicodeUTF8));
      } // retranslateUi
  
  };
  
  namespace Ui {
      class masterWidget: public Ui_masterWidget {};
  } // namespace Ui
  
  QT_END_NAMESPACE
  
  #endif // UI_MASTERUI_H
  </code></pre>