Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. QWebSocket( Qt 5.3.2. ). What is the alternative to open(QNetworkRequest)?
Forum Updated to NodeBB v4.3 + New Features

QWebSocket( Qt 5.3.2. ). What is the alternative to open(QNetworkRequest)?

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
5 Posts 3 Posters 577 Views 1 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.
  • M Offline
    M Offline
    manny777
    wrote on last edited by
    #1

    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 following

    m_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.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • M Offline
        M Offline
        manny777
        wrote on last edited by
        #3

        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.

        eyllanescE 1 Reply Last reply
        0
        • M manny777

          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.

          eyllanescE Offline
          eyllanescE Offline
          eyllanesc
          wrote on last edited by
          #4

          @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
          

          If you want me to help you develop some work then you can write to my email: e.yllanescucho@gmal.com.

          M 1 Reply Last reply
          1
          • eyllanescE eyllanesc

            @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
            
            M Offline
            M Offline
            manny777
            wrote on last edited by
            #5

            @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.

            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