{
setPriority
(QThread::LowestPriority);
connect(timer, SIGNAL(timeout()), this, SLOT(save()));
timer->start(60000);
}
void MyFileThread::save()
{
timer->stop();
resizeSuccess = file.resize(data->files_info->size);
}
MyFileThread::MyFileThread(QObject * parent ) : QThread(parent)
{
setPriority(QThread::LowestPriority);
timer = new QTimer();
connect(timer, SIGNAL(timeout()), this, SLOT(save()));
timer->start(60000);
}
void MyFileThread::save()
{
timer->stop();
QFile file("test.dat");
resizeSuccess = file.resize(data->files_info->size);
}
To copy to clipboard, switch view to plain text mode
I just tried it again (with fileThread= new MyFileThread()<-without the parent);, and it still stalls the gui until it's done resizing.
A WInAPI function to use is SetFilePointer() but you should remember that it's winapi and not protable. Also winapi isn't that easy for beginners.
I have never used winapi so it would be a new realm ..sigh.. but I will look it up
I've read there is also a possibility doing something similar in the ext3-linux filesystem
(but it will be primarily for win-xp)
thanks
Bookmarks