MCPcopy Index your code
hub / github.com/KDABLabs/cxx-qt-servo-webview

github.com/KDABLabs/cxx-qt-servo-webview @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
56 symbols 70 edges 11 files 3 documented · 5%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Servo WebView for Qt using CXX-Qt

KDAB has built a demo of using CXX-Qt to expose a Servo in Rust as a component to Qt.

Setup

  • Ensure that you have Qt installed and qmake in your PATH.
  • Ensure that you have the dependencies of ./mach boostrap from the https://github.com/servo/servo/ repository.
  • Alternatively use the shell.nix by installing Nix and then running nix-shell, it will take care of all dependencies automatically
  • Install the nightly compiler from February
$ rustup install nightly-2024-02-01
$ rustup default nightly-2024-02-01
  • Then run in release mode
$ cargo run --release

Note that this demo currently supports Wayland only, not X11.

Debugging

To make sure, that Qt picks the correct OpenGL driver, use the QSG_INFO=1 variable. For hardware acceleration to work, the driver name should not contain llvmpipe. Note that on embedded hardware it might be necessary to force servo to use OpenGL ES.

Nix

If you using Nix and if not on NixOS, make sure to run the final executable with the nixGLMesa wrapper (or if not on Mesa, with the correct wrapper for your driver). This will make sure that the OpenGL drivers are passed through from the host system with nixGL.

Licensing

This demo is Copyright (C) Klarälvdalens Datakonsult AB, and is available under the terms of the MPL-2.0 license.

Contact KDAB at info@kdab.com to inquire about additional features or services related to this project.

About KDAB

The KDAB Group is the global No.1 software consultancy for Qt, C++ and OpenGL applications across desktop, embedded and mobile platforms.

The KDAB Group provides consulting and mentoring for developing Qt applications from scratch and in porting from all popular and legacy frameworks to Qt. We continue to help develop parts of Qt and are one of the major contributors to the Qt Project. We can give advanced or standard trainings anywhere around the globe on Qt as well as C++, OpenGL, 3D and more.

Please visit https://www.kdab.com to meet the people who write code like this.

Core symbols most depended-on inside this repo

push_event
called by 5
src/browser.rs
get_events
called by 3
src/browser.rs
rendering_context
called by 2
src/windowheadless.rs
point
called by 2
src/webview.rs
key_event
called by 2
src/webview.rs
clone_box
called by 1
src/events_loop.rs
wake
called by 1
src/events_loop.rs
point_count
called by 1
src/webview.rs

Shape

Method 35
Class 10
Function 7
Enum 4

Languages

Rust91%
C++9%

Modules by API surface

src/webview.rs20 symbols
src/browser.rs7 symbols
src/renderer.rs6 symbols
src/windowheadless.rs5 symbols
src/servothread.rs4 symbols
src/events_loop.rs4 symbols
src/embedder.rs3 symbols
cpp/helpers.cpp3 symbols
cpp/helpers.h2 symbols
src/main.rs1 symbols
build.rs1 symbols

For agents

$ claude mcp add cxx-qt-servo-webview \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page