In QCPItemTracer::draw and QCPItemTracer::selectTest, the QRect returned from clipRect() is compared for intersection with various QRectF. This is done by converting the QRectF to QRect.
In Wireshark we have some cases where we suddenly shift values in an axis radically (converting times from relative times to absolute times), and the conversion overflows. Starting in Qt 6.10, this causes errors in Qt due to new overflow checks in the various Qt geometry classes:
https://github.com/qt/qtbase/commit/1145e1709d1072f7dd45683e9c25a14615603854
We patched QCustomPlot to convert the QRect to a QRectF instead and do the intersects comparison that way in floating-point mode to avoid the overflow, and that seems to work:
@@ -30722,13 +30722,13 @@ void QCPItemTracer::draw(QCPPainter *painter)
painter->setBrush(mainBrush());
QPointF center(position->pixelPosition());
double w = mSize/2.0;
- QRect clip = clipRect();
+ QRectF clip(clipRect());
switch (mStyle)
{
case tsNone: return;
case tsPlus:
{
- if (clip.intersects(QRectF(center-QPointF(w, w), center+QPointF(w, w)).toRect()))
+ if (clip.intersects(QRectF(center-QPointF(w, w), center+QPointF(w, w))))
{
painter->drawLine(QLineF(center+QPointF(-w, 0), center+QPointF(w, 0)));
painter->drawLine(QLineF(center+QPointF(0, -w), center+QPointF(0, w)));
@@ -30745,13 +30745,13 @@ void QCPItemTracer::draw(QCPPainter *painter)
}
case tsCircle:
{
- if (clip.intersects(QRectF(center-QPointF(w, w), center+QPointF(w, w)).toRect()))
+ if (clip.intersects(QRectF(center-QPointF(w, w), center+QPointF(w, w))))
painter->drawEllipse(center, w, w);
break;
}
case tsSquare:
{
- if (clip.intersects(QRectF(center-QPointF(w, w), center+QPointF(w, w)).toRect()))
+ if (clip.intersects(QRectF(center-QPointF(w, w), center+QPointF(w, w))))
painter->drawRect(QRectF(center-QPointF(w, w), center+QPointF(w, w)));
break;
}
(and similar in selectTest())