Skip to content

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

License

Notifications You must be signed in to change notification settings

jemc/qml-sockets

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

91 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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...")
}

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published