Thank you very much, but when you write:
We won't write your application. Read the documentation ....
This is general for me.
When I understand you right is this the right approach or?
#include <QtCore/QCoreApplication>
#include <QDebug>
#include <QObject>
#include "thrd_readfile.h"
#include "thrd_splitfile.h"
Q_OBJECT
public:
thread1 * mythread1 = new thread1();
QObject::connect(thr_mythread1 ,
SIGNAL(finished
()),
this,
SLOT(threadReadFileFinished
()));
thread * mythread2 = new thread2();
QObject::connect(thr_mythread2 ,
SIGNAL(finished
()),
this,
SLOT(threadSplitFileFinished
()));
mythread1 ->start();
mythread2 ->start();
}
public slots:
void threadReadFileFinished() {
qDebug("Executing slot threadReadFileFinished()");
}
void threadSplitFileFinished() {
qDebug("Executing slot threadSplitFileFinished()");
}
signals:
};
int main(int argc, char *argv[])
{
qDebug() << "Hallo";
MyObj* myThreadObject = new MyObj();
return a.exec();
}
#include <QtCore/QCoreApplication>
#include <QDebug>
#include <QObject>
#include "thrd_readfile.h"
#include "thrd_splitfile.h"
class MyObj: public QObject {
Q_OBJECT
public:
MyObj(QObject *parent = 0) : QObject(parent) {
thread1 * mythread1 = new thread1();
QObject::connect(thr_mythread1 , SIGNAL(finished()),this, SLOT(threadReadFileFinished()));
thread * mythread2 = new thread2();
QObject::connect(thr_mythread2 , SIGNAL(finished()),this, SLOT(threadSplitFileFinished()));
mythread1 ->start();
mythread2 ->start();
}
public slots:
void threadReadFileFinished() {
qDebug("Executing slot threadReadFileFinished()");
}
void threadSplitFileFinished() {
qDebug("Executing slot threadSplitFileFinished()");
}
signals:
};
int main(int argc, char *argv[])
{
QCoreApplication a(argc, argv);
qDebug() << "Hallo";
MyObj* myThreadObject = new MyObj();
return a.exec();
}
To copy to clipboard, switch view to plain text mode
Is tis ok?
Bookmarks