chore: formatter & clangd lsp option
C++ / fmt (pull_request) Successful in 5s
C++ / build (pull_request) Failing after 10s
C++ / clang-tidy (pull_request) Failing after 10s
JS/TS / fmt (pull_request) Successful in 7s
JS/TS / lint (pull_request) Successful in 9s
Python / static (pull_request) Successful in 27s
Rust / build (pull_request) Successful in 50s
Python / verify (pull_request) Successful in 1m40s
Rust / fmt (pull_request) Successful in 28s
Rust / clippy (pull_request) Successful in 45s

This commit is contained in:
2026-10-18 15:23:40 +02:00
parent 45aa6c9005
commit 08d42e1f8a
15 changed files with 73 additions and 78 deletions
@@ -84,7 +84,6 @@ SparklineSceneItem::LineSample SparklineSceneItem::buildSample(
points.reserve(len);
for (int i = 0; i < len; ++i) {
// Already smoothed once, incrementally, by the buffer itself.
const qreal value =
qBound<qreal>(0.0, buffer->smoothedAt(i), m_maxValue);
@@ -99,7 +98,7 @@ SparklineSceneItem::LineSample SparklineSceneItem::buildSample(
if (m_curveSmoothing && points.size() > 2) {
const qreal tension = 1.0;
const qreal k = tension / 6.0;
const int n = points.size();
const int n = static_cast<int>(points.size());
for (int i = 0; i < n - 1; ++i) {
const QPointF& p0 = points[qMax(i - 1, 0)];
const QPointF& p1 = points[i];
@@ -125,9 +124,6 @@ SparklineSceneItem::LineSample SparklineSceneItem::buildSample(
}
}
// Flatten the curve to a polyline once, here, on data change only.
// This is CPU math only -- no QPainter draw calls, no image, no
// texture upload happen as a result of this.
const auto subpaths = path.toSubpathPolygons();
if (subpaths.isEmpty()) return sample;
@@ -139,7 +135,7 @@ SparklineSceneItem::LineSample SparklineSceneItem::buildSample(
void SparklineSceneItem::writeFillGeometry(
QSGGeometryNode* node, const LineSample& sample) {
const int n = sample.polyline.size();
const int n = static_cast<int>(sample.polyline.size());
auto* geometry = node->geometry();
geometry->allocate(n * 2);
geometry->setDrawingMode(QSGGeometry::DrawTriangleStrip);
@@ -147,8 +143,10 @@ void SparklineSceneItem::writeFillGeometry(
auto* vertices = geometry->vertexDataAsPoint2D();
for (int i = 0; i < n; ++i) {
const QPointF& p = sample.polyline[i];
vertices[i * 2].set(p.x(), p.y());
vertices[i * 2 + 1].set(p.x(), sample.fillBottom);
vertices[i * 2].set(
static_cast<float>(p.x()), static_cast<float>(p.y()));
vertices[i * 2 + 1].set(
static_cast<float>(p.x()), static_cast<float>(sample.fillBottom));
}
node->markDirty(QSGNode::DirtyGeometry);
@@ -156,7 +154,7 @@ void SparklineSceneItem::writeFillGeometry(
void SparklineSceneItem::writeStrokeGeometry(
QSGGeometryNode* node, const LineSample& sample, qreal lineWidth) {
const int n = sample.polyline.size();
const int n = static_cast<int>(sample.polyline.size());
auto* geometry = node->geometry();
geometry->allocate(n * 2);
geometry->setDrawingMode(QSGGeometry::DrawTriangleStrip);
@@ -179,8 +177,12 @@ void SparklineSceneItem::writeStrokeGeometry(
const QPointF& p = sample.polyline[i];
const QPointF offset = normal * half;
vertices[i * 2].set(p.x() + offset.x(), p.y() + offset.y());
vertices[i * 2 + 1].set(p.x() - offset.x(), p.y() - offset.y());
vertices[i * 2].set(
static_cast<float>(p.x() + offset.x()),
static_cast<float>(p.y() + offset.y()));
vertices[i * 2 + 1].set(
static_cast<float>(p.x() - offset.x()),
static_cast<float>(p.y() - offset.y()));
}
node->markDirty(QSGNode::DirtyGeometry);
@@ -243,7 +245,7 @@ QSGNode* SparklineSceneItem::updatePaintNode(
}
QMatrix4x4 matrix;
matrix.translate(-stepX() * m_slideProgress, 0);
matrix.translate(static_cast<float>(-stepX() * m_slideProgress), 0.0f);
transformNode->setMatrix(matrix);
const bool needsGeometryWrite = samplesRebuilt || justCreated;