| Wireshark 4.7.3 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
21 class Marker : public QWidget {
22 Q_OBJECT
23 public:
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_; }
87 private:
89 int index_;
90
92 double x_coord_;
93
95 bool is_pos_marker_;
96
98 bool visible_;
99};
100
104 class MarkerDialog final : public QDialog{
105 Q_OBJECT
106
107 public:
114 MarkerDialog(QWidget* parent, bool showToMove, const QVector<Marker*>& markers);
115
119 ~MarkerDialog() final;
120
125 QString getText() const { return result_; }
126
131 QString selectedMarker() const { return selected_marker_; }
132 private slots:
137 void comboItemChanged(const QString& text);
138
139 private:
141 QString result_;
142
144 QString selected_marker_;
145
149 void reject() override;
150};
151#endif //CUSTOMPLOT_MARKER_H
MarkerDialog::selectedMarker
QString selectedMarker() const
Gets the currently selected marker's identifier.
Definition marker_dialog.h:131
MarkerDialog::getText
QString getText() const
Gets the resulting text input from the dialog.
Definition marker_dialog.h:125
MarkerDialog::~MarkerDialog
~MarkerDialog() final
Destroys the MarkerDialog.
MarkerDialog::MarkerDialog
MarkerDialog(QWidget *parent, bool showToMove, const QVector< Marker * > &markers)
Constructs a new MarkerDialog.
Definition marker_dialog.cpp:20
Marker::setVisibility
void setVisibility(const bool v)
Sets the visibility of the marker.
Definition marker_dialog.h:80
Marker::toHex
static QString toHex(long long value)
Converts a value to its hexadecimal string representation.
Definition marker_dialog.cpp:85
Marker::visible
bool visible() const
Checks if the marker is visible.
Definition marker_dialog.h:86
Marker::name
QString name() const
Gets the formatted name of the marker.
Definition marker_dialog.h:36
Marker::isPosMarker
bool isPosMarker() const
Checks if this is a position marker.
Definition marker_dialog.h:74
Marker::index
static int index(const Marker *m)
Retrieves the index of a given marker pointer.
Definition marker_dialog.h:49
Marker::xCoord
double xCoord() const
Gets the X coordinate of the marker.
Definition marker_dialog.h:62
Marker::Marker
Marker(const double x, const int index, const bool isPosMarker)
Constructs a new Marker.
Definition marker_dialog.cpp:78
Marker::index
int index() const
Gets the index of the marker.
Definition marker_dialog.h:42
Marker::setXCoord
void setXCoord(double value)
Sets the X coordinate of the marker.
Definition marker_dialog.cpp:94