The Qt 6 Book
Contribute!
Contribute!
  • Preface

    • Welcome!
    • Acknowledgements
    • Authors
  • Meet Qt

    • Qt and Qt Quick
    • Qt Building Blocks
    • Qt 6 Introduction
  • Getting Started

    • Quick Start
    • Installing Qt 6 SDK
    • Hello World
    • Application Types
    • Summary
  • Qt Creator IDE

    • Qt Creator IDE
    • The User Interface
    • Registering your Qt Kit
    • Managing Projects
    • Using the Editor
    • Locator
    • Debugging
    • Shortcuts
  • Quick Starter

    • Quick Starter
    • QML Syntax
    • Core Elements
    • Components
    • Simple Transformations
    • Positioning Elements
    • Layout Items
    • Input Elements
    • Advanced Techniques
  • Fluid Elements

    • Fluid Elements
    • Animations
    • States and Transitions
    • Advanced Techniques
  • QtQuick Controls

    • UI Controls
    • Introduction to Controls
    • An Image Viewer
    • Common Patterns
    • The Imagine Style
    • Summary
  • Model View

    • Model-View-Delegate
    • Concept
    • Basic Models
    • Dynamic Views
    • Delegate
    • Advanced Techniques
    • Summary
  • Canvas

    • Canvas Element
    • Convenience API
    • Gradients
    • Shadows
    • Images
    • Transformation
    • Composition Modes
    • Pixel Buffers
    • Canvas Paint
    • Porting from HTML5 Canvas
  • Shapes

    • Shapes
    • A Basic Shape
    • Building Paths
    • Filling Shapes
    • Animating Shapes
    • Summary
  • Effects

    • Effects in QML
    • Particle Concept
    • Simple Simulation
    • Particle Parameters
    • Directed Particles
    • Affecting Particles
    • Particle Groups
    • Particle Painters
    • Graphics Shaders
    • Shader Elements
    • Fragment Shaders
    • Wave Effect
    • Vertex Shader
    • Curtain Effect
    • Summary
  • Multimedia

    • Multimedia
    • Playing Media
    • Sound Effects
    • Video Streams
    • Capturing Images
    • Summary
  • Qt Quick 3D

    • Qt Quick 3D
    • The Basics
    • Working with Assets
    • Materials and Light
    • Animations
    • Mixing 2D and 3D Contents
    • Summary
  • Networking

    • Networking
    • Serving UI via HTTP
    • Templates
    • HTTP Requests
    • Local files
    • REST API
    • Authentication using OAuth
    • Web Sockets
    • Summary
  • Storage

    • Storage
    • Settings
    • Local Storage - SQL
  • Dynamic QML

    • Dynamic QML
    • Loading Components Dynamically
    • Creating and Destroying Objects
    • Tracking Dynamic Objects
    • Summary
  • Javascript

    • JavaScript
    • Browser/HTML vs Qt Quick/QML
    • JS Language
    • JS Objects
    • Creating a JS Console
  • Qt C++

    • Qt and C++
    • A Boilerplate Application
    • The QObject
    • Build Systems
    • Common Qt Classes
    • Models in C++
  • Extending QML

    • Extending QML with C++
    • Understanding the QML Run-time
    • Plugin Content
    • Creating the plugin
    • FileIO Implementation
    • Using FileIO
    • Summary
  • Qt for Python

    • Qt for Python
    • Introduction
    • Installing
    • Building an Application
    • Limitations
    • Summary
  • Qt for MCUs

    • Qt for MCUs
    • Setup
    • Hello World - for MCUs
    • Integrating with C++
    • Working with Models
    • Summary

Networking

Qt 6 comes with a rich set of networking classes on the C++ side. There are for example high-level classes on the HTTP protocol layer in a request-reply fashion such as QNetworkRequest, QNetworkReply and QNetworkAccessManager. But also lower levels classes on the TCP/IP or UDP protocol layer such as QTcpSocket, QTcpServer and QUdpSocket. Additional classes exist to manage proxies, network cache and also the systems network configuration.

This chapter will not be about C++ networking, this chapter is about Qt Quick and networking. So how can I connect my QML/JS user interface directly with a network service or how can I serve my user interface via a network service? There are good books and references out there to cover network programming with Qt/C++. Then it is just a manner to read the chapter about C++ integration to come up with an integration layer to feed your data into the Qt Quick world.

Help us improve this page!
Last Updated: 11/26/25, 7:55 PM
Contributors: Fabrice SALVAIRE
Next
Serving UI via HTTP