找回密码
 立即注册
收起左侧

QFtp传输过程出现错误崩溃

2
回复
5734
查看
[复制链接]
累计签到:3 天
连续签到:1 天
来源: 2016-9-6 09:31:22 显示全部楼层 |阅读模式
1Qter豆
调用QFtp进行传输时,
出现Qt has caught an exception thrown from an event handler. Throwingexceptions from an event handler is not supported in Qt. You must
reimplement QApplication::notify() and catch all exceptions there.

该报错,然后程序崩溃,请问这是什么问题呢

回复

使用道具 举报

尚未签到

2016-9-7 00:09:46 显示全部楼层
没有具体代码是很难知道为什么错的哦
回复

使用道具 举报

累计签到:3 天
连续签到:1 天
2016-9-7 11:32:53 显示全部楼层
ftp = new QFtp(this);
        connect(ftp,SIGNAL(commandFinished(int,bool)),this,SLOT(ftpCommandFinished(int,bool)));
        qDebug()<<"save_check_ip_quantity_update"<<i<<save_check_ip_quantity_update.at(i+ftp_ip_add)<<endl;
        ftp->connectToHost(save_check_ip_quantity_update.at(i+ftp_ip_add), Ftpport);
        ftp->login("ls@yf","Ls@46#3Y2016");
        qDebug()<<"Ftp ip"<<save_check_ip_quantity_update.at(i+ftp_ip_add);
        if(SSHtype == 2)
        {
            QFile configFile(ui->Config_file->text().trimmed());

            if(!configFile.open(QIODevice::ReadOnly))
            {
                qDebug()<<ui->Config_file->text().trimmed()<<"open fail"<<endl;
                qDebug()<<"File open error"<<configFile.errorString();
                return;
            }
            QByteArray configFileQA = configFile.readAll();

            ftp->put(configFileQA,FtpFileName,QFtp::Binary);
        }

        else if(SSHtype == 4)
        {
            QFile UpdateFile(ui->UpdateFile->text().trimmed());

            if(!UpdateFile.open(QIODevice::ReadOnly))
            {
                qDebug()<<ui->UpdateFile->text().trimmed()<<"open fail"<<endl;
                qDebug()<<"File open error"<<UpdateFile.errorString();
                return;
            }
            QByteArray UpdateFileQA = UpdateFile.readAll();

            ftp->put(UpdateFileQA,FtpFileName,QFtp::Binary);
        }


自己查了下,应该是QFtp多并发的问题,如果创建多个(我是创建8个),就会弹出上述错误,并且软件关闭
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

公告
可以关注我们的微信公众号yafeilinux_friends获取最新动态,或者加入QQ会员群进行交流:190741849、186601429(已满) 我知道了