mikrocat
11th November 2015, 12:54
Hi,
In my Dialogclass I open a file
if(file.open(QIODevice::ReadOnly | QIODevice::Text)){
ui->FileEdit->setText(filepath);
QByteArray firstlineArray = file.readLine();
ui->UpdateProgressBar->setRange(0,(file.size()-firstlineArray.size()));
firstlineArray.chop(1);
devicetypeFromFile = firstlineArray.toInt();
enableUpdateButton(true);
}
Now I want to have access to this file in my WorkerThread Class, because I need to read some lines from this file (it's a file with many hex-lines). The Dialog starts with a click on a Button the WorkerThread.
What is the best way to get the file to my Worker Thread?
In my Dialogclass I open a file
if(file.open(QIODevice::ReadOnly | QIODevice::Text)){
ui->FileEdit->setText(filepath);
QByteArray firstlineArray = file.readLine();
ui->UpdateProgressBar->setRange(0,(file.size()-firstlineArray.size()));
firstlineArray.chop(1);
devicetypeFromFile = firstlineArray.toInt();
enableUpdateButton(true);
}
Now I want to have access to this file in my WorkerThread Class, because I need to read some lines from this file (it's a file with many hex-lines). The Dialog starts with a click on a Button the WorkerThread.
What is the best way to get the file to my Worker Thread?