Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. Qt.WebSocket 1.0 on Android

Qt.WebSocket 1.0 on Android

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 3 Posters 2.0k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JosePacelli
    wrote on last edited by A Former User
    #1

    I'm creating a app the comunicate with websocket using QML Controls 2. When i make the aplication to DESKTOP (Ming Compiler) the aplication works perfect but when I change to Android them aplication compiles OK, but when open the page that use websockt show error QtWebSocket doesn found. !

    On QT Design when change to Android the import import Qt.WebSockets 1.0 stays with a red line.

    When compile to android show this warnings:

    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Material.impl
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Extras.Private.CppUtils
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.Universal.impl
    Warning: QML import could not be resolved in any of the import paths: QtQuick.Controls.impl

    When the aplication is runnig:
    W Gallery : (null):0 ((null)): Can't find surface 1
    W Gallery : (null):0 ((null)): QQmlComponent: Component is not ready
    W Gallery : (null):0 ((null)): qrc:/pages/Monitoramento.qml:2 module "Qt.WebSockets" plugin "declarative_qmlwebsockets" not found

    Version: QT 5.7.1 Android Windows com Ming32

    Anyone knows how to use the websocket in android?

    1 Reply Last reply
    0
    • R Offline
      R Offline
      Remon
      wrote on last edited by
      #2

      Without the dot it does work, so QtWebSockets works, Qt.WebSockets does not at least for me it does!

      Regards

      1 Reply Last reply
      0
      • D Offline
        D Offline
        danyright
        wrote on last edited by
        #3

        Hi,

        Yes, as mentioned in the documentation, at the very top of the WebSocket QML Type page (https://doc.qt.io/qt-5/qml-qtwebsockets-websocket.html), the import statement must be as follow :

        import QtWebSockets 1.0
        

        Or

        import QtWebSockets 1.1
        

        for Qt 5.8 and higher.

        You should change the post's status to resolve ;-)

        Daniel

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved