CodePudding user response:
Is it because the http://192.168.1.1:8080/? Action=stream this address in video stream, so the QNetworkAccessManager has been waiting for him to produce finished () signal, but the video transmission has not terminated, so did not trigger the finished signal?CodePudding user response:
Well solved finally oneself use QTcpSocket # include "mainwindow. H" # include "ui_mainwindow. H" mainwindow: : mainwindow (QWidget * parent) : QMainWindow (parent), UI (new UI: : mainwindow) {UI - & gt; SetupUi (this); TcpSocket=new QTcpSocket (this); TcpSocket - & gt; ConnectToHost (" 192.168.1.1 ", 8080); The connect (tcpSocket, SIGNAL (readyRead ()), and this, SLOT (tcpDataReceive ())); {} MainWindow: : ~ MainWindow () the delete UI; {} void MainWindow: : tcpDataReceive () QByteArray data=https://bbs.csdn.net/topics/QByteArray::fromHex (tcpSocket -> readAll ()); QDebug () write (" GET/? Action=stream \ r \ n \ r \ n "); }CodePudding user response:
You should use the readyRead (), rather than the finished ()CodePudding user response:
Qt novice for code