![]() |
Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
|
Bar graph of recent network round-trip samples. More...
#include <latency_graph_widget.h>
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. | |
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.
|
explicit |
|
overrideprotected |
| void LatencyGraphWidget::setSamples | ( | const QList< int > & | samplesMs | ) |
|
staticconstexpr |
Sample in milliseconds that maps to a fully red bar.
|
staticconstexprprivate |
Floor of the vertical scale in milliseconds. Keeps small windows readable.
|
private |