Sure,
I assume that you know how to use Signals and Slots.
So I just write the relevant relevant variables, signals and slots.
Maybe there is a typing error in in, but the principle works.
Please see the image above to get to know the structure and the goal.
I hope that this helps.
Don't wonder about the QThread.... QObject is also fine
ProcessData.h:
class ProcessData : public QThread
{
Q_OBJECT
public: explicit ProcessData(QObject *parent=0);
signals: sendPointer(SubProcessing1 *ptr);
public slots: void triggerPointerSending() {emit sendPointer(ptrSubPro);}
private:
SubProcessing1 SubPro;
SubProcessing1 *ptrSubPro;
};
ProcessData.cpp:
ProcessData::ProcessData(QObject *parent) : QThread(parent)
{ ptrSubPro = &SubPro}
GuiDialog.h
private: SubProcessing1 *ptrSubProcessing;
private slots:
void receivePointer(SubProcessing*) {ptrSubProcessing = ptr}
MainWindow.h
#include “subprocessing.h”
private:
ProcessData* myProcessedData
SubProcessingDialog* mySubProcessingDialog
private slots:
void DEBUGSLOT(SubProcessing *ptr);
MainWindow.cpp
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::MainWindow)
{
ui->setupUi(this);
mySubProcessingDialog = new SubProcessing();
myProcessedData = new ProcessData();
QObject::connect(myProcessedDate, SIGNAL(sendPointer(SubProcessing1*)),mySubProcessingDialog, SLOT(receivePointer(SubProcessing1*)));
myProcessedData.triggerPointerSending();
}