ScintillaQuick is a Qt Quick-native integration of the
Scintilla editing engine.
It is intended for applications that want Scintilla behavior inside a real
QQuickItem.
- A
ScintillaQuick_itemthat derives fromQQuickItem - Scintilla's editing model and message API on top of a Qt Quick surface
- Qt Quick-native focus, input, IME, and scene-graph rendering
- CMake package export for
find_package(ScintillaQuick) - A minimal example application, benchmark target, and validation tests
ScintillaQuick is usable today, but it is still an early-stage library.
Current repository state:
- Version
0.1.0 - Qt
6.12+ - Static library build
- C++ integration first
- Optional QML type registration helper is available
- CMake
3.25+ - A C++20 compiler
- Qt
6.12+with:CoreGuiQmlQuick
Target platforms:
- Windows
- Linux
- macOS
cmake -S . -B build
cmake --build buildThis builds:
ScintillaQuickstatic library- test executables when
BUILD_TESTING=ON
Examples and benchmarks are opt-in:
cmake -S . -B build -DSCINTILLAQUICK_BUILD_EXAMPLES=ON -DSCINTILLAQUICK_BUILD_BENCHMARKS=ONTo install the package:
cmake --install build --prefix <install-prefix>Installed consumers can then use find_package(ScintillaQuick CONFIG REQUIRED).
find_package(ScintillaQuick CONFIG REQUIRED)
target_link_libraries(my_app PRIVATE ScintillaQuick::ScintillaQuick)Public headers:
Installed packages expose Scintilla's public headers alongside the library. Scintilla internal implementation headers are intentionally not installed.
#include <QGuiApplication>
#include <QQuickWindow>
#include <scintillaquick/scintillaquick_item.h>
#include "Scintilla.h"
int main(int argc, char **argv) {
QGuiApplication app(argc, argv);
QQuickWindow window;
window.resize(1100, 720);
window.setColor(Qt::white);
ScintillaQuick_item editor;
editor.setParentItem(window.contentItem());
editor.setWidth(window.width());
editor.setHeight(window.height());
editor.setProperty("text", "hello from ScintillaQuick\n");
editor.send(SCI_STYLECLEARALL);
window.show();
editor.forceActiveFocus();
return app.exec();
}For a runnable example, see
examples/minimal_editor/main.cpp.
ScintillaQuick_item includes a bottom find panel. Ctrl+F opens its find row,
Ctrl+H opens both the find and replace rows, and Escape closes it. The panel
provides Find Previous, Find Next, Select All, Replace, Replace & Find, and
Replace All actions. Searches wrap at the beginning or end of the document.
Opening either panel seeds the search from a nonempty single-line selection.
With an empty or multiline selection, the previous search text is retained.
The panel can also be controlled directly from C++ or QML with
showFind(), showFindReplace(), and hideFindPanel(). Search behavior is
configured with Scintilla's SCFIND_* flags through findOptions:
editor.setFindText(QStringLiteral("needle"));
editor.setFindOptions(SCFIND_MATCHCASE | SCFIND_WHOLEWORD);
editor.showFind();The caller controls the panel font and its semantic colors:
editor.setFindPanelFont(QFont(QStringLiteral("Inter"), 10));
editor.setFindPanelBackgroundColor(QColor("#2d2d30"));
editor.setFindPanelForegroundColor(QColor("#e6e6e6"));
editor.setFindPanelFieldBackgroundColor(QColor("#252526"));
editor.setFindPanelFieldForegroundColor(QColor("#f0f0f0"));
editor.setFindPanelBorderColor(QColor("#3f3f46"));
editor.setFindPanelButtonHoverColor(QColor("#3e3e42"));Selection and disabled-state colors are separately available through
findPanelSelectionBackgroundColor, findPanelSelectionForegroundColor, and
findPanelDisabledForegroundColor.
The library exposes register_scintilla_type() in
scintillaquick_item.h, which
registers:
- module:
ScintillaQuick - version:
1.0 - type:
ScintillaQuick_item
CTest currently registers:
scintillaquick_smoke_testscintillaquick_dispatch_table_testscintillaquick_embedded_benchmarkwhenSCINTILLAQUICK_BUILD_BENCHMARKS=ONscintillaquick_frame_validation_testscintillaquick_renderer_software_1_testandscintillaquick_renderer_software_1_25_testscintillaquick_renderer_rhi_1_testandscintillaquick_renderer_rhi_1_25_teston Windowsscintillaquick_visual_regression_test
Run them with:
ctest --test-dir build --output-on-failureNotes:
- Stored visual baselines use Qt's software scene graph. Renderer conformance also checks the RHI scene graph on Windows; both backend checks run at device-pixel ratios 1 and 1.25 against Scintilla's drawing algorithms.
- On Windows, the visual tests use the normal
windowsQt platform plugin, so they require a desktop session rather than a truly headless environment.
include/: public headerssrc/: library implementationexamples/: sample applicationsbenchmarks/: benchmark applicationtests/: validation and regression testsdocs/: public project documentationthird_party/: vendored dependencies
third_party/scintilla/ is a maintained Scintilla fork
with capture and Qt Quick surface hooks. Its provenance record
and patch ledger describe the upstream
sources and local integration changes to preserve when updating the dependency.
Project code is released under the BSD 2-Clause license. See
LICENSE.
The repository also vendors Scintilla under its own license. See
third_party/scintilla/LICENSE.
ScintillaQuick does not require Lexilla. Applications that use lexers can call
scintillaquick_add_lexilla() after adding the ScintillaQuick subproject or finding
its installed package, then link Lexilla::Lexilla. This uses an existing target
or installed Lexilla package first, otherwise fetches upstream master and builds
against ScintillaQuick's public Scintilla headers. Set
FETCHCONTENT_SOURCE_DIR_LEXILLA or pass SOURCE_DIR <checkout> to select a local
checkout. Invalid explicit paths fail configuration.
The helper installs a separate Lexilla CMake package alongside ScintillaQuick;
installed applications can use find_package(Lexilla CONFIG REQUIRED) directly.
The optional ScintillaQuick::Syntax companion selects Lexilla lexers, keyword
sets and light/dark lexical colors for C/C++, QML/JavaScript, GLSL, JSON, Python,
CMake and Rust paths. Unknown paths use plain text. The core editor remains
independent of Lexilla.
Call scintillaquick_add_syntax() after adding the subproject or finding the
installed package, then link ScintillaQuick::Syntax. To build and install the
companion with ScintillaQuick itself, set SCINTILLAQUICK_BUILD_SYNTAX=ON.
An installed core-only package can build the companion through the same helper;
its source is included in the package. Repeated helper calls reuse the target.
Include <scintillaquick/scintillaquick_syntax.h> and call
scintillaquick::configure_default_syntax(pane, path, dark_mode) once with the
final language path and theme, then apply any application keyword, property or
color overrides. Configuration preserves the host's base font, backgrounds,
margins and predefined styles. Custom lexer owners can use
scintillaquick::reset_syntax_styles(pane) to clear lexical colors, emphasis and
keyword sets while retaining their lexer. Application-specific lexer policy
belongs to the host.