This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
NeoQCP is a fork of QCustomPlot (v2.1.1), a Qt-based C++20 plotting library. It is split into individual source files (the original QCustomPlot ships as a single amalgamated .h/.cpp pair). Licensed under GPL3.
Uses Meson with Qt6. Requires meson and ninja.
# Configure (default: release, tests on)
meson setup build
# Build
meson compile -C build
# Run all tests
meson test -C build
# Run tests with error output
meson test --print-errorlogs -C build
# Run benchmarks
meson test --benchmark -C build| Option | Default | Description |
|---|---|---|
tracy_enable |
false | Enable Tracy profiling (use with --buildtype=debugoptimized) |
with_examples |
false | Build example applications |
with_tests |
true | Build and enable tests |
Example: meson setup -Dtracy_enable=true --buildtype=debugoptimized build
The library builds as a static library (libNeoQCP.a). The public include header is src/qcustomplot.h which includes src/qcp.h (the umbrella header).
core.h/cpp—QCustomPlotwidget class (the main entry point). InheritsQRhiWidget. Owns layers, plottables, axes, layout system. Implementsinitialize()/render()/releaseResources()for RHI compositing.global.h— Macros, QCP namespace enums/flags, Qt includes. All other headers include this.axis/—QCPAxis,QCPRange, axis tickers (datetime, log, pi, text, time, fixed), label painterplottables/— Graph, curve, bars, colormap, financial, errorbar, statistical box. Base classQCPAbstractPlottableinplottable.h, 1D plottable template inplottable1d.hitems/— Overlay items (text, line, rect, ellipse, pixmap, bracket, curve, tracer, straight-line)layoutelements/— Axis rect, legend, color scale, text elementpainting/— Paint buffer hierarchy (QCPAbstractPaintBuffer→QCPPaintBufferPixmap,QCPPaintBufferRhi),QCPPainter, compositing shaders inshaders/polar/— Polar plot support (angular axis, radial axis, polar graph, polar grid)Profiling.hpp— Tracy profiling macros, compiles to no-ops whenTRACY_ENABLEis not defined
NeoQCP uses QRhiWidget (Qt 6.7+) for hardware-accelerated rendering:
- Replot phase (
replot()): Layers draw via QPainter into CPU-sideQImagestaging buffers (QCPPaintBufferRhi) - Render phase (
render()): Staging images are uploaded as GPU textures and composited via fullscreen quads with premultiplied alpha blending - Export paths (
savePdf(),toPixmap(), etc.): Use QPainter directly, bypassing the RHI pipeline
- QRhi rendering backend (
QCPPaintBufferRhiinpaintbuffer-rhi.h): Replaces the OpenGL FBO path. Each layer paints into a QImage staging buffer; at render time, textures are uploaded and composited on the GPU with no readback. - Tracy profiling integration via
Profiling.hppmacros. - Split source files instead of single amalgamated file.
auto/— Qt Test-based unit tests, compiled into a singleauto-testsexecutable. Tests for graph, curve, bars, financial, layout, axis rect, colormap, data container, legend, and QCustomPlot core.benchmark/— Performance benchmarks using Qt Test benchmarking.manual/— Manual/visual test application.big_data_for_tracy/— Tracy profiling test with large datasets.
GitHub Actions runs on Linux (x86_64 + aarch64), Windows, and macOS (Intel + Apple Silicon) with Qt 6. Build uses --buildtype debugoptimized.