Wireshark 4.7.0
The Wireshark network protocol analyzer
Loading...
Searching...
No Matches
marker_dialog.h
1
12#include "qobject.h"
13#include "qdialog.h"
14
15#ifndef CUSTOMPLOT_MARKER_H
16#define CUSTOMPLOT_MARKER_H
17
21class Marker : public QWidget {
22 Q_OBJECT
23public:
30 Marker(const double x, const int index, const bool isPosMarker);
31
36 QString name() const { return isPosMarker() ? QString("P") : QString("M%1").arg(index()); }
37
42 int index() const { return index_; }
43
49 static int index(const Marker* m) { return m ? m->index() : -1; }
50
56 static QString toHex(long long value);
57
62 double xCoord() const { return x_coord_; }
63
68 void setXCoord(double value);
69
74 bool isPosMarker() const { return is_pos_marker_; }
75
80 void setVisibility(const bool v) { visible_ = v; }
81
86 bool visible() const { return visible_; }
87private:
89 int index_;
90
92 double x_coord_;
93
95 bool is_pos_marker_;
96
98 bool visible_;
99};
100
104class MarkerDialog final : public QDialog{
105 Q_OBJECT
106
107public:
114 MarkerDialog(QWidget* parent, bool showToMove, const QVector<Marker*>& markers);
115
120
125 QString getText() const { return result_; }
126
131 QString selectedMarker() const { return selected_marker_; }
132private slots:
137 void comboItemChanged(const QString& text);
138
139private:
141 QString result_;
142
144 QString selected_marker_;
145
149 void reject() override;
150};
151#endif //CUSTOMPLOT_MARKER_H
A dialog for interacting with and selecting markers.
Definition marker_dialog.h:104
QString selectedMarker() const
Gets the currently selected marker's identifier.
Definition marker_dialog.h:131
QString getText() const
Gets the resulting text input from the dialog.
Definition marker_dialog.h:125
~MarkerDialog() final
Destroys the MarkerDialog.
A widget representing a marker on a graph or timeline.
Definition marker_dialog.h:21
void setVisibility(const bool v)
Sets the visibility of the marker.
Definition marker_dialog.h:80
static QString toHex(long long value)
Converts a value to its hexadecimal string representation.
Definition marker_dialog.cpp:85
bool visible() const
Checks if the marker is visible.
Definition marker_dialog.h:86
QString name() const
Gets the formatted name of the marker.
Definition marker_dialog.h:36
bool isPosMarker() const
Checks if this is a position marker.
Definition marker_dialog.h:74
static int index(const Marker *m)
Retrieves the index of a given marker pointer.
Definition marker_dialog.h:49
double xCoord() const
Gets the X coordinate of the marker.
Definition marker_dialog.h:62
int index() const
Gets the index of the marker.
Definition marker_dialog.h:42
void setXCoord(double value)
Sets the X coordinate of the marker.
Definition marker_dialog.cpp:94