| 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
18 class Marker : public QWidget {
19 Q_OBJECT
20 public:
21 Marker(const double x, const int, const bool isPosMarker);
22 QString name() const { return isPosMarker() ? QString("P") : QString("M%1").arg(index()); }
23 int index() const { return index_; }
24 static int index(const Marker* m) { return m ? m->index() : -1; }
25 static QString toHex(long long);
26 double xCoord() const { return x_coord_; }
27 void setXCoord(double value);
28 bool isPosMarker() const { return is_pos_marker_; }
29 void setVisibility(const bool v) { visible_ = v; }
30 bool visible() const { return visible_; }
31 private:
32 int index_;
33 double x_coord_;
34 bool is_pos_marker_;
35 bool visible_;
36};
37
38 class MarkerDialog final : public QDialog{
39 Q_OBJECT
40
41 public:
42 MarkerDialog(QWidget* parent, bool showToMove, const QVector<Marker*>& markers);
43 ~MarkerDialog() final;
44 QString getText() const { return result_; }
45 QString selectedMarker() const { return selected_marker_; }
46 private slots:
47 void comboItemChanged(const QString& text);
48
49 private:
50 QString result_;
51 QString selected_marker_;
52 void reject() override;
53};
54#endif //CUSTOMPLOT_MARKER_H
MarkerDialog
Definition marker_dialog.h:38
Marker
Definition marker_dialog.h:18