title: Testing Qt application in Visual Studio - Qt files giving 'cannot open source file' error when including project files in test file
body: <p>I'm trying to write tests for a Qt application in visual studio.  I've added a new test project to the existing solution that has the project I'm wanting to test, and added a reference to said project as shown <a href="https://docs.microsoft.com/en-us/visualstudio/test/writing-unit-tests-for-c-cpp?view=vs-2017" rel="nofollow noreferrer">here</a>.  When I try to run a test file, I get errors saying 'cannot open source file "x"' for a bunch of Qt and Qt generated files like QWidget and 'ui_x.h' (x is a placeholder).  I'm using Google Test, but the same issue occurs when using the 'Native Unit Test Project' option.</p>
  
  <p>Image of problem</p>
  
  <p><a href="https://i.stack.imgur.com/DzsOQ.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/DzsOQ.png" alt="enter image description here"></a></p>
  
  <p>Settings.h</p>
  
  <pre><code>#pragma once
  
  #include &lt;string&gt;
  #include &lt;QWidget&gt;
  #include &lt;QSettings&gt;
  #include &lt;QFileDialog&gt;
  
  #include "ui_Settings.h"
  
  extern const std::string MODS_FOLDER_PATH;
  extern const std::string  PROFILE_PATH;
  
  class Settings : public QWidget
  {
      Q_OBJECT
  
  public:
      Settings(QWidget *parent = Q_NULLPTR, QString testHook = "");
      QString getModsFolderPath();
  
  public slots:
      void browseProfilePath();
      void browseModsPath();
      void openSettingsWidget();
  
  signals:
      void modsFolderPathChanged(const QString &amp;newPath);
      void profilePathChanged();
  
  private:
      Ui::Options ui;
      QString testHook;
      QString fileBrowser(QFileDialog::FileMode fileMode, const std::string  = "");
      bool changeFileSetting(QLineEdit * const settingInput, const std::string setting, const QString &amp;fileName);
      void loadValuesFromSettings();
  };
  </code></pre>
  
  <p>test.cpp</p>
  
  <pre><code>#include "pch.h"
  #include "../FileOverwriteManager/Settings.h"
  
  TEST(TestCaseName, TestName) {
    EXPECT_EQ(1, 1);
    EXPECT_TRUE(true);
  }
  </code></pre>