Hello friends,
When I click my Gui B button it starts a QThread.
//**************************************************************************
{
Q_OBJECT
public:
virtual ~CheckFile() { }
public slots:
protected:
void run();
private:
private slots:
signals:
};
class CheckFile : public QThread
//**************************************************************************
{
Q_OBJECT
public:
CheckFile(const QString &p_inFile,
const QString &p_notInsertedFile,
QObject* parent = 0);
virtual ~CheckFile() { }
public slots:
protected:
void run();
private:
QString qstr_inFile;
QString qstr_notInsertedFile;
private slots:
signals:
void setText(const QString &);
};
To copy to clipboard, switch view to plain text mode
in the implementation I parse a file and emit for every line a settext like this
void CheckFile::run()
{
...
emit setText(str);
}
void CheckFile::run()
{
QString str;
...
emit setText(str);
}
To copy to clipboard, switch view to plain text mode
In the Slot function for my button clicked event I declare my connection for the Thread :
connect(thr_CheckFile, SIGNAL(setText(const QString& )), bodyEdit, SLOT(append(const QString&)));
connect(thr_CheckFile, SIGNAL(setText(const QString& )), bodyEdit, SLOT(append(const QString&)));
To copy to clipboard, switch view to plain text mode
after the text are append to my Qtextedit in my gui my window freeze that means I can not do anything and the memory using grows up
Any Suggestions ??
Bookmarks