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

Status bar presentation of server round-trip health. More...

#include <latency_status_widget.h>

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

Public Slots

void updateData (const LatencyTracker::Stats &stats, const QList< int > &samplesMs)

Public Member Functions

 LatencyStatusWidget (QWidget *parent=nullptr)

Protected Member Functions

bool eventFilter (QObject *watched, QEvent *event) override

Private Member Functions

void togglePopup ()
QString statsText (const LatencyTracker::Stats &stats) const

Private Attributes

QLabel * pingLabel = nullptr
LatencyGraphWidgetlatencyGraph = nullptr
QWidget * popup = nullptr
LatencyGraphWidgetdetailGraph = nullptr
QLabel * detailLabel = nullptr
QList< int > latestSamples

Detailed Description

Status bar presentation of server round-trip health.

Combines the textual "Ping" readout with a small LatencyGraphWidget sparkline of the rolling sample window. Clicking anywhere in the area opens a popup with a larger graph and the numeric statistics. It closes on any outside click. Stays hidden while disconnected or before any samples exist. Owns all latency display state so MainWindow only needs to forward one signal here.

Constructor & Destructor Documentation

◆ LatencyStatusWidget()

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

Member Function Documentation

◆ eventFilter()

bool LatencyStatusWidget::eventFilter ( QObject * watched,
QEvent * event )
overrideprotected
Here is the call graph for this function:

◆ statsText()

QString LatencyStatusWidget::statsText ( const LatencyTracker::Stats & stats) const
private
Here is the caller graph for this function:

◆ togglePopup()

void LatencyStatusWidget::togglePopup ( )
private
Here is the caller graph for this function:

◆ updateData

void LatencyStatusWidget::updateData ( const LatencyTracker::Stats & stats,
const QList< int > & samplesMs )
slot
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ detailGraph

LatencyGraphWidget* LatencyStatusWidget::detailGraph = nullptr
private

◆ detailLabel

QLabel* LatencyStatusWidget::detailLabel = nullptr
private

◆ latencyGraph

LatencyGraphWidget* LatencyStatusWidget::latencyGraph = nullptr
private

◆ latestSamples

QList<int> LatencyStatusWidget::latestSamples
private

◆ pingLabel

QLabel* LatencyStatusWidget::pingLabel = nullptr
private

◆ popup

QWidget* LatencyStatusWidget::popup = nullptr
private

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