Skip to content

imakris/ScintillaQuick

Repository files navigation

ScintillaQuick

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.

What It Provides

  • A ScintillaQuick_item that derives from QQuickItem
  • 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

Status

ScintillaQuick is usable today, but it is still an early-stage library.

CI Status

Platform Static Shared CI test run Consumer install smoke Notes
Linux 🟢 🟢 🟢 🟢 GitHub Actions runs dispatch-table, smoke, and frame-validation tests.
macOS 🟢 🟢 🟢 🟢 GitHub Actions runs dispatch-table, smoke, and frame-validation tests.
Windows 🟢 🟢 🟢 🟢 Shared-build test jobs add build/Release to PATH so ScintillaQuick.dll is found at runtime.

Current master status: all GitHub Actions matrix jobs pass on Qt 6.7.2.

Current repository state:

  • Version 0.1.0
  • Qt 6.7+
  • Static library build
  • C++ integration first
  • Optional QML type registration helper is available

Requirements

  • CMake 3.24+
  • A C++20 compiler
  • Qt 6.7+ with:
    • Core
    • Gui
    • Qml
    • Quick

Target platforms:

  • Windows
  • Linux
  • macOS

Build

cmake -S . -B build
cmake --build build

This builds:

  • ScintillaQuick static library
  • scintillaquick_minimal_editor
  • scintillaquick_embedded_benchmark
  • test executables when BUILD_TESTING=ON

To install the package:

cmake --install build --prefix <install-prefix>

Installed consumers can then use find_package(ScintillaQuick CONFIG REQUIRED).

Use From CMake

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.

Minimal C++ Usage

#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.

QML Registration

The library exposes register_scintilla_type() in scintillaquick_item.h, which registers:

  • module: ScintillaQuick
  • version: 1.0
  • type: ScintillaQuick_item

Testing

CTest currently registers:

  • scintillaquick_smoke_test
  • scintillaquick_dispatch_table_test
  • scintillaquick_embedded_benchmark
  • scintillaquick_frame_validation_test
  • scintillaquick_visual_regression_test

Run them with:

ctest --test-dir build --output-on-failure

Notes:

  • Visual-regression coverage uses Qt's software scene graph for deterministic output.
  • On Windows, the visual tests use the normal windows Qt platform plugin, so they require a desktop session rather than a truly headless environment.

Repository Layout

Documentation

License

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.

About

Qt Quick-native Scintilla editor component

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors