Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ThreadsCopy threadA("thread A",model->index(i,1).data().toString(),newDir+"/"+QFileInfo(model->index(i,1).data().toString()).fileName());
- threadA.start();
- #ifndef THREADSCOPY_H
- #define THREADSCOPY_H
- #include <QThread>
- #include <login.h>
- #include <QFile>
- class ThreadsCopy : public QThread
- {
- public:
- explicit ThreadsCopy(QString threadName, QString fromPath, QString toPath);
- // Переопределяем метод run(), в котором будет
- // располагаться выполняемый код
- void run();
- QString _fromPath;
- QString _toPath;
- QMessageBox msgBox;
- private:
- QString name; // Имя потока
- };
- #endif // THREADSCOPY_H
- #include "threadscopy.h"
- #include <QDebug>
- ThreadsCopy::ThreadsCopy(QString threadName, QString fromPath, QString toPath) :
- name(threadName),
- _fromPath(fromPath),
- _toPath(toPath)
- {
- }
- void ThreadsCopy::run()
- {
- qDebug()<<name;
- qDebug()<<_fromPath;
- qDebug()<<_toPath;
- QFile::copy(_fromPath,_toPath);
- }
Add Comment
Please, Sign In to add comment