RiveQtQuickPlugin2 is a Qt Quick plugin for playing Rive .riv files with
the official Rive runtime and renderer. The repository name is
RiveQtQuickPlugin2, but the QML import remains RiveQtQuick.
The goal is to keep rendering fast by integrating directly with Qt Quick's RHI
backends and sharing rendering resources across all RiveItem instances in the
scene. Desktop builds also include a best-effort QPainter software backend for
Qt Quick's Software graphics API.
import RiveQtQuick
RiveItem {
source: "qrc:/animations/example.riv"
}- Qt
6.6.0and newer - official Rive runtime integration
- Qt Quick / RHI based rendering
- shared rendering context across all Rive items
.rivfile caching to avoid duplicate loads- example apps for quick manual testing
- unit tests and QML tests
- Direct3D 11 on Windows
- Direct3D 12 when available in the bundled Rive runtime
- OpenGL 4.2+ on Windows and Linux through Qt Quick's graphics API switch
- Vulkan when available in the bundled Rive runtime
- Metal on macOS and iOS
- Software rendering through QPainter in a best effort approach (its slower than Hardware and visual losses)
- OpenGL ES
- rendering is slower
- advanced blend parity can differ from GPU backends, especially for
hue,saturation,color, andluminosity - feather softness is approximated and may render without the full soft-edge effect
- textured image meshes use a triangle fallback and can show seam or sampling differences compared with GPU backends
Right now the project is exercised most heavily on Windows and Apple platforms. Release builds are the ones that matter for performance. Debug builds are fine for development, but can be noticeably slower on complex animations.
The icon grid demo shows a 100 x 100 table of buttons, each with its own live
RiveItem.
buttons_with_rive_icons.mp4
src/RiveQtQuickcontains the pluginexamplescontains the demo applicationstestscontains unit and QML coveragescriptscontains helper scriptscmakecontains platform and dependency setup
riveqtquick_minimalis the smallest viewerriveqtquick_interactiveis a compact interactive demo appriveqtquick_marketplace_demois a marketplace browser / inspector demo that loads assets from the official Rive marketplaceriveqtquick_icon_gridshows a large grid of Qt Quick buttons with live Rive icons inside
The repository expects the 3rdparty/ folder to be present.
Fetch or refresh it with:
python ./scripts/bootstrap.pyThe top-level CMake project exposes a few useful switches:
RIVEQT_BUILD_EXAMPLES=ON|OFFbuilds the example applicationsRIVEQT_BUILD_TESTS=ON|OFFbuilds the unit and QML testsRIVEQT_ENABLE_OPENGL=ON|OFFenables the desktop OpenGL backend on Windows/LinuxRIVEQT_ENABLE_METAL=ON|OFFenables the Metal backend on Apple platformsRIVEQT_ENABLE_SOFTWARE=ON|OFFenables the desktop QPainter software backendRIVEQT_IOS_BUNDLE_ID_PREFIX=<prefix>sets the generated iOS example app bundle identifiersRIVEQT_IOS_DEVELOPMENT_TEAM=<team-id>sets an explicit Apple development team for iOS signing
RIVEQT_ENABLE_OPENGL defaults to ON on Windows/Linux and OFF on Apple platforms.
RIVEQT_ENABLE_METAL defaults to ON on Apple platforms and OFF elsewhere.
RIVEQT_ENABLE_SOFTWARE defaults to ON on desktop builds and OFF on mobile
platforms.
Backend selection stays in Qt. For example, request OpenGL before creating the first window:
QQuickWindow::setGraphicsApi(QSGRendererInterface::OpenGL);The desktop OpenGL backend requires an actual OpenGL 4.2+ core context.
For the software backend:
QQuickWindow::setGraphicsApi(QSGRendererInterface::Software);Typical Windows build with MSVC 2022:
cmake -S . -B build -G "Visual Studio 17 2022" -A x64 -DCMAKE_PREFIX_PATH=<qt-path>
cmake --build build --config Release --target RiveQtQuickBuild the examples:
cmake --build build --config Release --target \
riveqtquick_minimal \
riveqtquick_interactive \
riveqtquick_marketplace_demo \
riveqtquick_icon_gridExample Ninja build on macOS:
cmake -S . -B build-macos -G Ninja \
-DCMAKE_BUILD_TYPE=RelWithDebInfo \
-DCMAKE_PREFIX_PATH=<qt-path> \
-RIVEQT_BUILD_EXAMPLES=ON \
-RIVEQT_BUILD_TESTS=ON
cmake --build build-macos --target RiveQtQuickFor iOS, configure with Qt's iOS toolchain file and a host Qt installation:
cmake -S . -B build-ios -G Xcode \
-DCMAKE_TOOLCHAIN_FILE=<qt-ios>/lib/cmake/Qt6/qt.toolchain.cmake \
-DQT_HOST_PATH=<qt-host-path> \
-DCMAKE_OSX_SYSROOT=iphoneos \
-RIVEQT_BUILD_EXAMPLES=ON \
-RIVEQT_BUILD_TESTS=OFFThe CMake setup includes Apple-specific handling for Qt kits that do not ship
arm64 iOS Simulator frameworks. If your simulator build links against device
frameworks by mistake, reconfigure for x86_64 simulator builds or use
iphoneos for device builds.
ctest --test-dir build --output-on-failureThe QML test runner also accepts an explicit backend override:
./tests-bin/riveqtquick_qml_tests --graphics-api openglopengl is supported on Windows/Linux only and requires a desktop OpenGL 4.2+ context.
./tests-bin/riveqtquick_qml_tests --graphics-api softwareMulti-config generators such as Visual Studio can still use:
ctest --test-dir build -C Debug --output-on-failureThe repository includes GitHub Actions workflows for:
- the general CI build and test matrix
- Apple-specific macOS build/test coverage
- unsigned iOS example app builds
MIT