All Projects → jemc → qml-sockets

jemc / qml-sockets

Licence: MIT license
Exposing Qt's C++ socket objects to QML for declarative use.

Programming Languages

QML
638 projects
C++
36643 projects - #6 most used programming language
QMake
1090 projects
ruby
36898 projects - #4 most used programming language

QML Sockets

Exposing Qt's C++ socket objects to QML for declarative use.

Overview

Qt says:

QML offers a highly readable, declarative, JSON-like syntax with support for imperative JavaScript expressions combined with dynamic property bindings.

Qt also provides some very useful socket objects in their QtNetwork C++ API.

However, Qt does not provide these objects in a QML API. This plugin is an attempt do so in order to simplify socket programming for basic applications. The QML API provided may not be able to handle some of the more advanced use cases, but the lowered ceremony it brings to socket programming can get you from idea to implementation in just a few lines:

import Sockets 1.0

TCPSocket {
    host: "www.the-world.com"
    port: 1025
    
    Component.onCompleted: connect()
    
    onConnected: write("Hello, World!")
    
    onRead: console.log("The World says:", message)
    
    onDisconnected: console.log("Goodbye, Cruel World...")
}
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].