Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
LatencyGraphWidget Class Reference

Bar graph of recent network round-trip samples. More...

#include <latency_graph_widget.h>

Inheritance diagram for LatencyGraphWidget:
[legend]
Collaboration diagram for LatencyGraphWidget:
[legend]

Public Member Functions

 LatencyGraphWidget (QWidget *parent=nullptr)
void setSamples (const QList< int > &samplesMs)

Static Public Attributes

static constexpr qint64 ColorScaleMs = 500
 Sample in milliseconds that maps to a fully red bar.

Protected Member Functions

void paintEvent (QPaintEvent *event) override

Private Attributes

QList< int > samples

Static Private Attributes

static constexpr qint64 MinScaleMs = 100
 Floor of the vertical scale in milliseconds. Keeps small windows readable.

Detailed Description

Bar graph of recent network round-trip samples.

Draws one bar per sample, oldest on the left. Bar height is relative to the window's own scale so the shape of the variance stays readable, while bar color maps each sample onto an absolute quality ramp (green at rest through red at ColorScaleMs) so a steady good ping never looks alarming. Size agnostic: the status bar embeds a small instance while the latency detail popup shows a large one.

Constructor & Destructor Documentation

◆ LatencyGraphWidget()

LatencyGraphWidget::LatencyGraphWidget ( QWidget * parent = nullptr)
explicit

Member Function Documentation

◆ paintEvent()

void LatencyGraphWidget::paintEvent ( QPaintEvent * event)
overrideprotected

◆ setSamples()

void LatencyGraphWidget::setSamples ( const QList< int > & samplesMs)

Member Data Documentation

◆ ColorScaleMs

qint64 LatencyGraphWidget::ColorScaleMs = 500
staticconstexpr

Sample in milliseconds that maps to a fully red bar.

◆ MinScaleMs

qint64 LatencyGraphWidget::MinScaleMs = 100
staticconstexprprivate

Floor of the vertical scale in milliseconds. Keeps small windows readable.

◆ samples

QList<int> LatencyGraphWidget::samples
private

The documentation for this class was generated from the following files: