QWebSocket( Qt 5.3.2. ). What is the alternative to open(QNetworkRequest)?
-
Nice to meet you.
Sorry, My English is not very good. ( I use translation software. )I'm using QWebSocket( Qt 5.3.2. ) to create a client.
I want to write a header to authenticate the connection to the server.
The Qt 5.6 can do the followingm_websocket = new QWebSocket();
~
QNetworkRequest request;
request.setUrl(QUrl(m_strURL));
QByteArray byteHeader = "key";
request.setRawHeader(byteHeader, "keykey");
m_websocket.open(request);There is no open(QNetworkRequest) in qt5.3.2.
Please tell me another way.Thank you for your cooperation.
-
Hi and welcome to devnet,
Unless you are locked to 5.3.2, update Qt. This version is more than outdated.
Otherwise you will have to back port that method since it's available starting with 5.6.
-
Thanks for the reply.
Unfortunately, the Qt version is locked at 5.3.2.
This is the first time I learned about the backport feature.
I'll look into it.
Thank you for your cooperation.If there is any other way to implement this without using open(request), please let me know.
-
Thanks for the reply.
Unfortunately, the Qt version is locked at 5.3.2.
This is the first time I learned about the backport feature.
I'll look into it.
Thank you for your cooperation.If there is any other way to implement this without using open(request), please let me know.
@manny777 A possible solution is for you to download the Qt 5.6 source code from QtWebSockets and if you are lucky it will probably be compatible with Qt 5.3.2:
git clone -b 5.6 git://code.qt.io/qt/qtwebsockets.git mkdir build cd build qmake ../qtwebsockets make make install -
@manny777 A possible solution is for you to download the Qt 5.6 source code from QtWebSockets and if you are lucky it will probably be compatible with Qt 5.3.2:
git clone -b 5.6 git://code.qt.io/qt/qtwebsockets.git mkdir build cd build qmake ../qtwebsockets make make install@eyllanesc
Thanks for the reply.
That's one way to do it, isn't it?
I'll give it a try.Thank you for your cooperation.