wie ist es zu bewerkstelligen in einer Thread klasse auf die .ui file zuzugreifen?
//thread.h
Code: Alles auswählen
#ifndef THREAD_H
#define THREAD_H
#include <QThread>
#include "ui_tpopt.h"
#include <QtGui/QMainWindow>
class Thread : public QThread {
Q_OBJECT
public:
Thread();
protected:
void run();
private:
Ui::tpoptClass u;
};Code: Alles auswählen
#include "thread.h"
#include "tpopt.h"
#include <QTextStream>
#include <QFile>
Thread::Thread() {
}
void Thread::run() {
ui. textEdit_5->setText(“test“);
}Code: Alles auswählen
#ifndef TPOPT_H
#define TPOPT_H
#include <QtGui/QMainWindow>
#include "ui_tpopt.h"
#include "ui_projekt.h"
#include "projekt.h"
#include "thread.h"
class tpopt : public QMainWindow
{
Q_OBJECT
public:
tpopt(QWidget *parent = 0, Qt::WFlags flags = 0);
~tpopt();
private:
Thread thread1;
Ui::tpoptClass ui;
public slots:
};
#endif // TPOPT_HLeider bricht das Programm mit der Fehlermeldung ab:
Unbehandelte Ausnahme bei 0x652f42da (QtGuid4.dll) in tpopt.exe: 0xC0000005: Zugriffsverletzung beim Lesen an Position 0xccccccd0.
Class Q_GUI_EXPORT QTextEdit : public QAbstractScrollArea
{
…
Q_DECLARE_PRIVATE(QTextEdit)
…
Bin für jeden Tip sehr dankbar.
Danke
lg