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
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:
@@ -187,7 +187,7 @@ void CarouselView::setModel(const QVariantList& m) {
|
||||
|
||||
emit modelChanged();
|
||||
|
||||
const int newCount = m_model.size();
|
||||
const int newCount = static_cast<int>(m_model.size());
|
||||
|
||||
if (newCount == 0) {
|
||||
m_currentRealIndex = -1;
|
||||
@@ -647,7 +647,7 @@ qreal CarouselView::sampleSize(qreal childLoc) const {
|
||||
}
|
||||
|
||||
int CarouselView::realIndexOf(int virtualIndex) const {
|
||||
const int count = m_model.size();
|
||||
const int count = static_cast<int>(m_model.size());
|
||||
|
||||
if (count == 0) return -1;
|
||||
|
||||
@@ -668,7 +668,7 @@ qreal CarouselView::snapTargetX(qreal x) const {
|
||||
}
|
||||
|
||||
void CarouselView::wrapContentIfNeeded() {
|
||||
const int count = m_model.size();
|
||||
const int count = static_cast<int>(m_model.size());
|
||||
|
||||
if (count == 0) return;
|
||||
|
||||
@@ -707,7 +707,7 @@ void CarouselView::wrapContentIfNeeded() {
|
||||
}
|
||||
|
||||
void CarouselView::updateCurrentIndexFromContentX(bool emitPreview) {
|
||||
const int count = m_model.size();
|
||||
const int count = static_cast<int>(m_model.size());
|
||||
|
||||
if (count == 0) return;
|
||||
|
||||
@@ -856,8 +856,8 @@ void CarouselView::positionSlot(const Slot& slot) const {
|
||||
return rightIndex == n ? m_arrangement.outerSpacing : m_itemSpacing;
|
||||
};
|
||||
|
||||
const auto leftGap = [this, n](int leftIndex) {
|
||||
return leftIndex == -n ? m_arrangement.outerSpacing : m_itemSpacing;
|
||||
const auto leftGap = [this, n](int gapIndex) {
|
||||
return gapIndex == -n ? m_arrangement.outerSpacing : m_itemSpacing;
|
||||
};
|
||||
|
||||
qreal center = 0;
|
||||
@@ -974,7 +974,7 @@ void CarouselView::releaseAllItems() {
|
||||
}
|
||||
|
||||
void CarouselView::relayout() {
|
||||
const int count = m_model.size();
|
||||
const int count = static_cast<int>(m_model.size());
|
||||
|
||||
if (count == 0 || width() <= 0 || m_focalWidth <= 0) {
|
||||
for (Slot& s : m_slots) {
|
||||
@@ -1038,7 +1038,7 @@ void CarouselView::relayout() {
|
||||
m_slots.append(Slot{});
|
||||
slotUsedThisPass.append(false);
|
||||
|
||||
freeSlot = m_slots.size() - 1;
|
||||
freeSlot = static_cast<int>(m_slots.size()) - 1;
|
||||
}
|
||||
|
||||
updateSlotContent(m_slots[freeSlot], v);
|
||||
@@ -1092,7 +1092,7 @@ void CarouselView::snapToNearest() {
|
||||
}
|
||||
|
||||
void CarouselView::goToIndex(int realIndex) {
|
||||
const int count = m_model.size();
|
||||
const int count = static_cast<int>(m_model.size());
|
||||
|
||||
if (count == 0) return;
|
||||
|
||||
@@ -1126,7 +1126,7 @@ void CarouselView::decrementCurrentIndex() {
|
||||
}
|
||||
|
||||
void CarouselView::centerInstantlyOnReal(int realIndex) {
|
||||
const int count = m_model.size();
|
||||
const int count = static_cast<int>(m_model.size());
|
||||
|
||||
if (count == 0) return;
|
||||
|
||||
@@ -1220,7 +1220,7 @@ qreal CarouselView::sampledVelocity() const {
|
||||
const VelocitySample& oldest = m_velocitySamples.first();
|
||||
const VelocitySample& newest = m_velocitySamples.last();
|
||||
|
||||
const qreal dt = newest.t - oldest.t;
|
||||
const qreal dt = static_cast<qreal>(newest.t - oldest.t);
|
||||
|
||||
if (dt < 8) return 0;
|
||||
|
||||
|
||||
@@ -252,8 +252,6 @@ int ChatListView::count() const {
|
||||
}
|
||||
|
||||
bool ChatListView::event(QEvent* e) {
|
||||
// qDebug() << "ChatListView::event() runs";
|
||||
|
||||
return QQuickItem::event(e);
|
||||
}
|
||||
|
||||
@@ -366,7 +364,6 @@ void ChatListView::updatePolish() {
|
||||
m_animateY = false;
|
||||
const int layoutSize = static_cast<int>(m_layout.size());
|
||||
const qint64 now = m_clock.elapsed();
|
||||
bool wrote = false;
|
||||
for (auto& entry : m_delegates) {
|
||||
if (!entry.item || entry.pendingRemoval || entry.pendingInsert)
|
||||
continue;
|
||||
@@ -397,7 +394,6 @@ void ChatListView::updatePolish() {
|
||||
entry.item->setY(target);
|
||||
entry.hasPropY = false;
|
||||
}
|
||||
wrote = true;
|
||||
}
|
||||
|
||||
applyAnchor();
|
||||
|
||||
@@ -50,8 +50,6 @@ void SparklineContent::setLine2(internal::CircularBuffer* buffer) {
|
||||
|
||||
void SparklineContent::connectBuffer(internal::CircularBuffer* buffer) {
|
||||
if (!buffer) return;
|
||||
// New data, or the buffer's own smoothingRadius changed (it re-emits
|
||||
// valuesChanged in that case too) -> geometry is stale.
|
||||
connect(
|
||||
buffer,
|
||||
&internal::CircularBuffer::valuesChanged,
|
||||
@@ -67,7 +65,7 @@ void SparklineContent::connectBuffer(internal::CircularBuffer* buffer) {
|
||||
void SparklineContent::setLine1Color(const QColor& color) {
|
||||
if (m_line1Color == color) return;
|
||||
m_line1Color = color;
|
||||
update(); // visual-only, no geometry rebuild needed
|
||||
update();
|
||||
}
|
||||
|
||||
void SparklineContent::setLine2Color(const QColor& color) {
|
||||
@@ -173,7 +171,7 @@ SparklineContent::LineGeometry SparklineContent::buildGeometry(
|
||||
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)];
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -85,7 +85,7 @@ class WavyLine : public QCanvasPainterItem {
|
||||
[[nodiscard]] qreal value() const;
|
||||
void setValue(qreal value);
|
||||
|
||||
signals:
|
||||
signals:
|
||||
void lineWidthChanged();
|
||||
void amplitudeMultiplierChanged();
|
||||
void frequencyChanged();
|
||||
|
||||
Reference in New Issue
Block a user