Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
latency_status_widget.h
Go to the documentation of this file.
1
5
6#ifndef LATENCY_STATUS_WIDGET_H
7#define LATENCY_STATUS_WIDGET_H
8
9#include <QList>
10#include <QWidget>
12
13class QLabel;
15
26class LatencyStatusWidget : public QWidget
27{
28 Q_OBJECT
29public:
30 explicit LatencyStatusWidget(QWidget *parent = nullptr);
31
32public slots:
33 void updateData(const LatencyTracker::Stats &stats, const QList<int> &samplesMs);
34
35protected:
36 bool eventFilter(QObject *watched, QEvent *event) override;
37
38private:
39 void togglePopup();
40 QString statsText(const LatencyTracker::Stats &stats) const;
41
42 QLabel *pingLabel = nullptr;
44 QWidget *popup = nullptr;
46 QLabel *detailLabel = nullptr;
47 QList<int> latestSamples;
48};
49
50#endif
Bar graph of recent network round-trip samples.
Definition latency_graph_widget.h:23
void updateData(const LatencyTracker::Stats &stats, const QList< int > &samplesMs)
Definition latency_status_widget.cpp:38
QWidget * popup
Definition latency_status_widget.h:44
bool eventFilter(QObject *watched, QEvent *event) override
Definition latency_status_widget.cpp:62
QString statsText(const LatencyTracker::Stats &stats) const
Definition latency_status_widget.cpp:106
LatencyGraphWidget * detailGraph
Definition latency_status_widget.h:45
LatencyGraphWidget * latencyGraph
Definition latency_status_widget.h:43
LatencyStatusWidget(QWidget *parent=nullptr)
Definition latency_status_widget.cpp:15
QList< int > latestSamples
Definition latency_status_widget.h:47
void togglePopup()
Definition latency_status_widget.cpp:71
QLabel * pingLabel
Definition latency_status_widget.h:42
QLabel * detailLabel
Definition latency_status_widget.h:46
Definition latency_tracker.h:27