Need a little help with QThread
so i have a class that is used to upload and download files from an ftp server.
The class inherits QThread, so i initialize my ftp class in my constructor, then when i try to do a save/download i first do this
Code:
sftp.
start(QThread::NormalPriority);
sftp.get(filename);
sftp.terminate();
that doesnt seem to work, my program locks up when i download the file, and of course, once i get the file, the program resumes.
I then tried to initialize the ftp class in my constructor then immediately after initializing i call a
Code:
sftp.
start(QThread::NormalPriority);
i call my gets/sends then at the de-constructor of the class i call
i saw the same behavior. anyone have any suggestions?
Re: Need a little help with QThread
anyone have any suggestions?
Re: Need a little help with QThread
The constructor is run in the same thread as the calling thread, so you need to put the code that takes the time into the run method of the thread.
Re: Need a little help with QThread
I dont quite understand what you mean. where should i call a start on my new thread?
Re: Need a little help with QThread