QWebSocket for some reason wont work on android but works fine on Windows
Unsolved
Mobile and Embedded
-
i've setup this
connect(&m_webSocket, QOverload<QAbstractSocket::SocketError>::of(&QWebSocket::error), [=](QAbstractSocket::SocketError error){ qDebug() << "Websocket ERROR : " << m_webSocket.errorString(); });
and get this
[SOCKET][INFO] We are closing the connection Websocket ERROR : "Socket is not connected"
even printing the "error" gives
QAbstractSocket::UnknownSocketError
code im using to connect to server
void MainWindow::connectTo(QString selected_board) { _socket.doConnect(QStringLiteral("ws://%1:80").arg(selected_board)); }
-
wait.... i just found the problem....
this line
#if defined(Q_OS_ANDROID) QScroller::grabGesture(ui->scrollAreaPaletteContent, QScroller::LeftMouseButtonGesture); #endif
made QWebsocket not work....... wait what!!!
i commented that line out and socket works on my android tablet now :S
if i uncomment it then socket dont work no more :Si a super confused!
-
Hi,
This one looks pretty strange indeed.
Does the disconnection happen when you use the gesture or just having it enabled does that as well ?