Wireshark  4.3.0
The Wireshark network protocol analyzer
overlay_scroll_bar.h
Go to the documentation of this file.
1 
10 #ifndef __OVERLAY_SCROLL_BAR_H__
11 #define __OVERLAY_SCROLL_BAR_H__
12 
13 #include <QScrollBar>
14 
15 class QProxyStyle;
16 
17 class OverlayScrollBar : public QScrollBar
18 {
19  Q_OBJECT
20 
21 public:
22  OverlayScrollBar(Qt::Orientation orientation, QWidget * parent = 0);
23  virtual ~OverlayScrollBar();
24 
25  virtual QSize sizeHint() const;
26  virtual int sliderPosition();
27 
41  void setNearOverlayImage(QImage &overlay_image, int packet_count = -1, int start_pos = -1, int end_pos = -1, QList<int> positions = QList<int>(), int rowHeight = 1);
42 
48  void setMarkedPacketImage(QImage &mp_image);
49 
50 
53  QRect grooveRect();
54 
55 public slots:
56  void setChildRange(int min, int max) { child_sb_.setRange(min, max); }
57 
58 protected:
59  virtual void resizeEvent(QResizeEvent * event);
60  virtual void paintEvent(QPaintEvent * event);
61  virtual bool eventFilter(QObject *watched, QEvent *event);
62  virtual void mousePressEvent(QMouseEvent *) { /* No-op */ }
63  virtual void mouseReleaseEvent(QMouseEvent * event);
64 
65 private:
66  QProxyStyle* style_;
67  QProxyStyle* child_style_;
68  QScrollBar child_sb_;
69  QImage packet_map_img_;
70  QImage marked_packet_img_;
71  int packet_map_width_;
72  int marked_packet_width_;
73  int packet_count_;
74  int start_pos_;
75  int end_pos_;
76  QList<int> positions_;
77  int row_height_;
78 
79 #if QT_VERSION >= QT_VERSION_CHECK(6, 1, 0)
80  void updateChildStyle();
81 #endif
82 };
83 
84 #endif // __OVERLAY_SCROLL_BAR_H__
Definition: overlay_scroll_bar.h:18
QRect grooveRect()
Definition: overlay_scroll_bar.cpp:142
void setNearOverlayImage(QImage &overlay_image, int packet_count=-1, int start_pos=-1, int end_pos=-1, QList< int > positions=QList< int >(), int rowHeight=1)
Definition: overlay_scroll_bar.cpp:112
void setMarkedPacketImage(QImage &mp_image)
Definition: overlay_scroll_bar.cpp:132