title: C++ header file issue in VScode
body: <p>I had created an artificial horizon instrument using Qt designer. I converted the .ui file to python with pyuic. The converted python file is dependent on a C++ and .h file. But the header files in the c++ and .h files are not compatible in vscode.</p>
  <p>Below is my python code:</p>
  <pre class="lang-py prettyprint-override"><code>from PyQt5 import QtCore, QtGui, QtWidgets
  
  
  class Ui_MainWindow(object):
      def setupUi(self, MainWindow):
          MainWindow.setObjectName(&quot;MainWindow&quot;)
          MainWindow.resize(800, 600)
          self.centralwidget = QtWidgets.QWidget(MainWindow)
          self.centralwidget.setObjectName(&quot;centralwidget&quot;)
          self.gridLayout_3 = QtWidgets.QGridLayout(self.centralwidget)
          self.gridLayout_3.setObjectName(&quot;gridLayout_3&quot;)
          self.widget_2 = QtWidgets.QWidget(self.centralwidget)
          self.widget_2.setObjectName(&quot;widget_2&quot;)
          self.gridLayout_2 = QtWidgets.QGridLayout(self.widget_2)
          self.gridLayout_2.setObjectName(&quot;gridLayout_2&quot;)
          spacerItem = QtWidgets.QSpacerItem(20, 460, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
          self.gridLayout_2.addItem(spacerItem, 3, 0, 1, 1)
          self.label = QtWidgets.QLabel(self.widget_2)
          self.label.setObjectName(&quot;label&quot;)
          self.gridLayout_2.addWidget(self.label, 0, 0, 1, 1)
          self.doubleSpinBox = QtWidgets.QDoubleSpinBox(self.widget_2)
          self.doubleSpinBox.setMinimum(-90.0)
          self.doubleSpinBox.setMaximum(90.0)
          self.doubleSpinBox.setObjectName(&quot;doubleSpinBox&quot;)
          self.gridLayout_2.addWidget(self.doubleSpinBox, 0, 1, 1, 1)
          self.doubleSpinBox_2 = QtWidgets.QDoubleSpinBox(self.widget_2)
          self.doubleSpinBox_2.setMinimum(-180.0)
          self.doubleSpinBox_2.setMaximum(180.0)
          self.doubleSpinBox_2.setObjectName(&quot;doubleSpinBox_2&quot;)
          self.gridLayout_2.addWidget(self.doubleSpinBox_2, 1, 1, 1, 1)
          self.label_2 = QtWidgets.QLabel(self.widget_2)
          self.label_2.setObjectName(&quot;label_2&quot;)
          self.gridLayout_2.addWidget(self.label_2, 1, 0, 1, 1)
          self.gridLayout_3.addWidget(self.widget_2, 0, 0, 1, 1)
          self.widget = QtWidgets.QWidget(self.centralwidget)
          self.widget.setObjectName(&quot;widget&quot;)
          self.gridLayout = QtWidgets.QGridLayout(self.widget)
          self.gridLayout.setObjectName(&quot;gridLayout&quot;)
          spacerItem1 = QtWidgets.QSpacerItem(20, 102, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
          self.gridLayout.addItem(spacerItem1, 0, 1, 1, 1)
          spacerItem2 = QtWidgets.QSpacerItem(164, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
          self.gridLayout.addItem(spacerItem2, 1, 0, 1, 1)
          self.graphicsEADI = qfi_EADI(self.widget)
          self.graphicsEADI.setEnabled(False)
          self.graphicsEADI.setMinimumSize(QtCore.QSize(300, 300))
          self.graphicsEADI.setMaximumSize(QtCore.QSize(300, 300))
          self.graphicsEADI.setFrameShape(QtWidgets.QFrame.NoFrame)
          self.graphicsEADI.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
          self.graphicsEADI.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
          self.graphicsEADI.setInteractive(False)
          self.graphicsEADI.setObjectName(&quot;graphicsEADI&quot;)
          self.gridLayout.addWidget(self.graphicsEADI, 1, 1, 1, 1)
          spacerItem3 = QtWidgets.QSpacerItem(163, 20, QtWidgets.QSizePolicy.Expanding, QtWidgets.QSizePolicy.Minimum)
          self.gridLayout.addItem(spacerItem3, 1, 2, 1, 1)
          spacerItem4 = QtWidgets.QSpacerItem(20, 101, QtWidgets.QSizePolicy.Minimum, QtWidgets.QSizePolicy.Expanding)
          self.gridLayout.addItem(spacerItem4, 2, 1, 1, 1)
          self.gridLayout_3.addWidget(self.widget, 0, 1, 1, 1)
          MainWindow.setCentralWidget(self.centralwidget)
          self.menubar = QtWidgets.QMenuBar(MainWindow)
          self.menubar.setGeometry(QtCore.QRect(0, 0, 800, 21))
          self.menubar.setObjectName(&quot;menubar&quot;)
          MainWindow.setMenuBar(self.menubar)
          self.statusbar = QtWidgets.QStatusBar(MainWindow)
          self.statusbar.setObjectName(&quot;statusbar&quot;)
          MainWindow.setStatusBar(self.statusbar)
  
          self.retranslateUi(MainWindow)
          QtCore.QMetaObject.connectSlotsByName(MainWindow)
  
      def retranslateUi(self, MainWindow):
          _translate = QtCore.QCoreApplication.translate
          MainWindow.setWindowTitle(_translate(&quot;MainWindow&quot;, &quot;MainWindow&quot;))
          self.label.setText(_translate(&quot;MainWindow&quot;, &quot;Pitch&quot;))
          self.label_2.setText(_translate(&quot;MainWindow&quot;, &quot;Roll&quot;))
          
  from qfi.qfi_EADI import qfi_EADI        #it needs to import qfi_EADI which is a cpp file
  
  
  if __name__ == &quot;__main__&quot;:
      import sys
      app = QtWidgets.QApplication(sys.argv)
      MainWindow = QtWidgets.QMainWindow()
      ui = Ui_MainWindow()
      ui.setupUi(MainWindow)
      MainWindow.show()
      sys.exit(app.exec_())
  </code></pre>
  <p>Below is my qfi_EADI cpp file</p>
  <pre class="lang-cpp prettyprint-override"><code>#include &lt;qfi/qfi_AI.h&gt;
  
  #ifdef WIN32
  #   include &lt;float.h&gt;
  #endif
  
  #include &lt;cmath&gt;     //gives error
  
  ////////////////////////////////////////////////////////////////////////////////
  
  qfi_AI::qfi_AI( QWidget *parent ) :
      QGraphicsView ( parent ),
  
      _scene ( Q_NULLPTR ),
  
      _itemBack ( Q_NULLPTR ),
      _itemFace ( Q_NULLPTR ),
      _itemRing ( Q_NULLPTR ),
      _itemCase ( Q_NULLPTR ),
  
      _roll  ( 0.0 ),
      _pitch ( 0.0 ),
  
      _faceDeltaX_new ( 0.0 ),
      _faceDeltaX_old ( 0.0 ),
      _faceDeltaY_new ( 0.0 ),
      _faceDeltaY_old ( 0.0 ),
  
      _scaleX ( 1.0 ),
      _scaleY ( 1.0 ),
  
      _originalHeight ( 240 ),
      _originalWidth  ( 240 ),
  
      _originalPixPerDeg ( 1.7 ),
  
      _originalAdiCtr ( 120.0 , 120.0 ),
  
      _backZ ( -30 ),
      _faceZ ( -20 ),
      _ringZ ( -10 ),
      _caseZ (  10 )
  {
      reset();
  
      _scene = new QGraphicsScene( this );
      setScene( _scene );
  
      _scene-&gt;clear();
  
      init();
  }
  
  ////////////////////////////////////////////////////////////////////////////////
  
  qfi_AI::~qfi_AI()
  {
      if ( _scene != Q_NULLPTR )
      {
          _scene-&gt;clear();
          delete _scene;
          _scene = Q_NULLPTR;
      }
  
      reset();
  }
  
  ////////////////////////////////////////////////////////////////////////////////
  
  void qfi_AI::reinit()
  {
      if ( _scene )
      {
          _scene-&gt;clear();
  
          init();
      }
  }
  
  ////////////////////////////////////////////////////////////////////////////////
  
  void qfi_AI::redraw()
  {
      if ( isVisible() )
      {
          updateView();
  
          _faceDeltaX_old  = _faceDeltaX_new;
          _faceDeltaY_old  = _faceDeltaY_new;
      }
  }
  
  ////////////////////////////////////////////////////////////////////////////////
  
  void qfi_AI::setRoll( double roll )
  {
      _roll = roll;
  
      if ( _roll &lt; -180.0 ) _roll = -180.0;
      if ( _roll &gt;  180.0 ) _roll =  180.0;
  }
  
  ////////////////////////////////////////////////////////////////////////////////
  
  void qfi_AI::setPitch( double pitch )
  {
      _pitch = pitch;
  
      if ( _pitch &lt; -25.0 ) _pitch = -25.0;
      if ( _pitch &gt;  25.0 ) _pitch =  25.0;
  }
  
  ////////////////////////////////////////////////////////////////////////////////
  
  void qfi_AI::resizeEvent( QResizeEvent *event )
  {
      ////////////////////////////////////
      QGraphicsView::resizeEvent( event );
      ////////////////////////////////////
  
      reinit();
  }
  
  ////////////////////////////////////////////////////////////////////////////////
  
  void qfi_AI::init()
  {
      _scaleX = static_cast&lt; double &gt;( width()  ) / static_cast&lt; double &gt;( _originalWidth  );
      _scaleY = static_cast&lt; double &gt;( height() ) / static_cast&lt; double &gt;( _originalHeight );
  
      reset();
  
      _itemBack = new QGraphicsSvgItem( &quot;:/qfi/images/ai/ai_back.svg&quot; );
      _itemBack-&gt;setCacheMode( QGraphicsItem::NoCache );
      _itemBack-&gt;setZValue( _backZ );
      _itemBack-&gt;setTransform( QTransform::fromScale( _scaleX, _scaleY ), true );
      _itemBack-&gt;setTransformOriginPoint( _originalAdiCtr );
      _scene-&gt;addItem( _itemBack );
  
      _itemFace = new QGraphicsSvgItem( &quot;:/qfi/images/ai/ai_face.svg&quot; );
      _itemFace-&gt;setCacheMode( QGraphicsItem::NoCache );
      _itemFace-&gt;setZValue( _faceZ );
      _itemFace-&gt;setTransform( QTransform::fromScale( _scaleX, _scaleY ), true );
      _itemFace-&gt;setTransformOriginPoint( _originalAdiCtr );
      _scene-&gt;addItem( _itemFace );
  
      _itemRing = new QGraphicsSvgItem( &quot;:/qfi/images/ai/ai_ring.svg&quot; );
      _itemRing-&gt;setCacheMode( QGraphicsItem::NoCache );
      _itemRing-&gt;setZValue( _ringZ );
      _itemRing-&gt;setTransform( QTransform::fromScale( _scaleX, _scaleY ), true );
      _itemRing-&gt;setTransformOriginPoint( _originalAdiCtr );
      _scene-&gt;addItem( _itemRing );
  
      _itemCase = new QGraphicsSvgItem( &quot;:/qfi/images/ai/ai_case.svg&quot; );
      _itemCase-&gt;setCacheMode( QGraphicsItem::NoCache );
      _itemCase-&gt;setZValue( _caseZ );
      _itemCase-&gt;setTransform( QTransform::fromScale( _scaleX, _scaleY ), true );
      _scene-&gt;addItem( _itemCase );
  
      centerOn( width() / 2.0 , height() / 2.0 );
  
      updateView();
  }
  
  ////////////////////////////////////////////////////////////////////////////////
  
  void qfi_AI::reset()
  {
      _itemBack = Q_NULLPTR;
      _itemFace = Q_NULLPTR;
      _itemRing = Q_NULLPTR;
      _itemCase = Q_NULLPTR;
  
      _roll  = 0.0;
      _pitch = 0.0;
  
      _faceDeltaX_new = 0.0;
      _faceDeltaX_old = 0.0;
      _faceDeltaY_new = 0.0;
      _faceDeltaY_old = 0.0;
  }
  
  ////////////////////////////////////////////////////////////////////////////////
  
  void qfi_AI::updateView()
  {
      _scaleX = static_cast&lt; double &gt;( width()  ) / static_cast&lt; double &gt;( _originalWidth  );
      _scaleY = static_cast&lt; double &gt;( height() ) / static_cast&lt; double &gt;( _originalHeight );
  
      _itemBack-&gt;setRotation( - _roll );
      _itemFace-&gt;setRotation( - _roll );
      _itemRing-&gt;setRotation( - _roll );
  
      double roll_rad = M_PI * _roll / 180.0;
  
      double delta  = _originalPixPerDeg * _pitch;
  
      _faceDeltaX_new = _scaleX * delta * sin( roll_rad );
      _faceDeltaY_new = _scaleY * delta * cos( roll_rad );
  
      _itemFace-&gt;moveBy( _faceDeltaX_new - _faceDeltaX_old, _faceDeltaY_new - _faceDeltaY_old );
  
      _scene-&gt;update();
  }
  </code></pre>
  <p>And below is my qfi_AI.h file</p>
  <pre class="lang-cpp prettyprint-override"><code>#ifndef QFI_AI_H
  #define QFI_AI_H
  
  ////////////////////////////////////////////////////////////////////////////////
  
  #include &lt;QGraphicsView&gt;        //gives error
  #include &lt;QGraphicsSvgItem&gt;     //gives error
  
  ////////////////////////////////////////////////////////////////////////////////
  
  /**
   * @brief Attitude Indicator widget class.
   */
  class qfi_AI : public QGraphicsView
  {
      Q_OBJECT
  
  public:
  
      /** Constructor. */
      explicit qfi_AI( QWidget *parent = Q_NULLPTR );
  
      /** Destructor. */
      virtual ~qfi_AI();
  
      /** Reinitiates widget. */
      void reinit();
  
      /** Refreshes (redraws) widget. */
      void redraw();
  
      /** @param roll angle [deg] */
      void setRoll( double roll );
  
      /** @param pitch angle [deg] */
      void setPitch( double pitch );
  
  protected:
  
      /** */
      void resizeEvent( QResizeEvent *event );
  
  private:
  
      QGraphicsScene *_scene;
  
      QGraphicsSvgItem *_itemBack;
      QGraphicsSvgItem *_itemFace;
      QGraphicsSvgItem *_itemRing;
      QGraphicsSvgItem *_itemCase;
  
      double _roll;
      double _pitch;
  
      double _faceDeltaX_new;
      double _faceDeltaX_old;
      double _faceDeltaY_new;
      double _faceDeltaY_old;
  
      double _scaleX;
      double _scaleY;
  
      const int _originalHeight;
      const int _originalWidth;
  
      const double _originalPixPerDeg;
  
      QPointF _originalAdiCtr;
  
      const int _backZ;
      const int _faceZ;
      const int _ringZ;
      const int _caseZ;
  
      void init();
  
      void reset();
  
      void updateView();
  };
  
  ////////////////////////////////////////////////////////////////////////////////
  
  #endif // QFI_AI_H
  </code></pre>
  <p>How do I get rid of the header file issue, should I import the source code for each header file separately or is there a shortcut?</p>