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. Network connection in QML?
QtWS25 Last Chance

Network connection in QML?

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
6 Posts 2 Posters 2.6k Views
  • 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.
  • S Offline
    S Offline
    Sam009
    wrote on last edited by
    #1

    Hello I'm new to QML, QT and C ++, but I have some questions for qml.
    Is it possible to create an network connection with qml?
    Also possible to connect to a server?
    If so, how do to do it?

    ODБOïO 1 Reply Last reply
    0
    • S Sam009

      Hello I'm new to QML, QT and C ++, but I have some questions for qml.
      Is it possible to create an network connection with qml?
      Also possible to connect to a server?
      If so, how do to do it?

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by
      #2

      @Sam009 Hi,

      In QML pure you only have XMLHttpRequest.

      But you can extend qml with qt c++ for tcp/ftp ..

      http://doc.qt.io/qt-5/topics-network-connectivity.html

      S 1 Reply Last reply
      2
      • ODБOïO ODБOï

        @Sam009 Hi,

        In QML pure you only have XMLHttpRequest.

        But you can extend qml with qt c++ for tcp/ftp ..

        http://doc.qt.io/qt-5/topics-network-connectivity.html

        S Offline
        S Offline
        Sam009
        wrote on last edited by
        #3

        @LeLev Hi
        Thanks,

        There is no code on how to create an internet connection?
        But you can extend qml with qt c++ for tcp/ftp ..
        If I'm a part in c ++ can I then grab from qml to the c ++ function (which is there for the internet connection)?

        ODБOïO 1 Reply Last reply
        0
        • S Sam009

          @LeLev Hi
          Thanks,

          There is no code on how to create an internet connection?
          But you can extend qml with qt c++ for tcp/ftp ..
          If I'm a part in c ++ can I then grab from qml to the c ++ function (which is there for the internet connection)?

          ODБOïO Offline
          ODБOïO Offline
          ODБOï
          wrote on last edited by
          #4

          hi Sam,
          @Sam009 said in Network connection in QML?:

          There is no code on how to create an internet connection?

          Of cours there are lot of exemples (with your qt creator go to : HOME > Exemples )
          What exactly you want to do ? where you want to connect? what is the protocole ?

          @Sam009 said in Network connection in QML?:

          If I'm a part in c ++ can I then grab from qml to the c ++ function (which is there for the internet connection)?

          Yes you can ! To communicate between c++ and qml : http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html
          you will use Q_PROPERTIES / Q_INVOKABLES / public Slots

          S 1 Reply Last reply
          2
          • ODБOïO ODБOï

            hi Sam,
            @Sam009 said in Network connection in QML?:

            There is no code on how to create an internet connection?

            Of cours there are lot of exemples (with your qt creator go to : HOME > Exemples )
            What exactly you want to do ? where you want to connect? what is the protocole ?

            @Sam009 said in Network connection in QML?:

            If I'm a part in c ++ can I then grab from qml to the c ++ function (which is there for the internet connection)?

            Yes you can ! To communicate between c++ and qml : http://doc.qt.io/qt-5/qtqml-cppintegration-exposecppattributes.html
            you will use Q_PROPERTIES / Q_INVOKABLES / public Slots

            S Offline
            S Offline
            Sam009
            wrote on last edited by Sam009
            #5

            @LeLev

            The idea is to make a internet connection to a server or web to open some htmls . The htmls are normaly Json-stings.
            I need somthing that i can make use inside a qml(or c++ file) that make a connection to a server/web. My file is a plugin for a software.
            Which example can I take?

            This example are working, so i have only import this examples and set the parameter? (if i find this example /these examples)
            Then I didn´t need a c++ file? only a qml file?

            ODБOïO 1 Reply Last reply
            0
            • S Sam009

              @LeLev

              The idea is to make a internet connection to a server or web to open some htmls . The htmls are normaly Json-stings.
              I need somthing that i can make use inside a qml(or c++ file) that make a connection to a server/web. My file is a plugin for a software.
              Which example can I take?

              This example are working, so i have only import this examples and set the parameter? (if i find this example /these examples)
              Then I didn´t need a c++ file? only a qml file?

              ODБOïO Offline
              ODБOïO Offline
              ODБOï
              wrote on last edited by
              #6

              Hi,

              @Sam009 said in Network connection in QML?:

              The idea is to make a internet connection to a server or web to open some htmls .

              XMLHttpRequest can be used for opening HTML pages : http://doc.qt.io/qt-5/qtqml-xmlhttprequest-example.html (pure QML)

              Google "xhr get html page qml" will give you more exemples.

              Also, feel free to send me an email and i will share with you (google drive) a little app i made.

              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