I have a basic c++ question and I cant find the answer, so I decided to ask you guys.

I am building a Qt Application with the following hierarchy:

1. MainWindow
2. SubWindow in mdiArea of MainWindow
3. Adding QTabWidget to the SubWindow
4. UserInputWidget as first Tab

Now in the UserInputWidget I am calling a function that computes a QVector. With the QVector I am building a QwtPlotCurve... from here on I want to add a Tab to the QTabWidget calling a Function in the UserInput.cpp that is declared in the SubWindow.cpp

But I have to set a reference to the SubWindow ... how can I do that ?

code till here:
Header
Qt Code:
  1. class SubWindow : public QMdiSubWindow
  2. {
  3. Q_OBJECT
  4. public:
  5. explicit SubWindow(QWidget *parent, int Form);
  6.  
  7. signals:
  8.  
  9. public slots:
  10.  
  11. public:
  12. void addCurve(QWidget *curve);
To copy to clipboard, switch view to plain text mode 
CPP
Qt Code:
  1. void SubWindow::addCurve(QWidget *curve)
  2. {
  3. subWindowTabWidget.addTab(curve, curve->windowTitle());
  4. }
To copy to clipboard, switch view to plain text mode 

UserInput calling the function
Qt Code:
  1. curvefhPlot = new curvefh;
  2. curvefhPlot->fhPlotCurve->setSamples(calculationAlgoClass->fhCurvePointVector);
  3. curvefhPlot->setWindowTitle(tr("F-h - Diagramm"));
  4. SubWindow::addCurve(curvefhPlot); <---- SubWindow is not a declared Object...
To copy to clipboard, switch view to plain text mode 


I am building the subWindow over a function in the MainWindow...
Qt Code:
  1. SubWindow *MainWindow::createSubWindow()
  2. {
  3. SubWindow *subWindow = new SubWindow(this, 0);
  4. mdiArea.addSubWindow(subWindow);
  5. subWindow->showMaximized();
  6. return subWindow;
  7. }
To copy to clipboard, switch view to plain text mode 

any suggestions ?