aboutsummaryrefslogtreecommitdiffstats
path: root/ui/qt/byte_view_text.h
diff options
context:
space:
mode:
authorGerald Combs <gerald@zing.org>2014-10-26 18:48:14 -0700
committerGerald Combs <gerald@wireshark.org>2014-10-27 02:05:13 +0000
commit1c159818fd9a1cbc667d7aa675ed776e3c202523 (patch)
treecd0c77b30818d1cfdd609bfd1395e529c0dbffb9 /ui/qt/byte_view_text.h
parentc33deaa92f0bf607778d7b20668c3bba23446c2e (diff)
Qt: ByteViewText hover information.
When the user hovers over a byte view field, highlight it and show a description in the status bar. Add a "byte" status bar context and fix a label stack pop bug. Keep proto_find_field_from_offset from matching generated items. Otherwise hovering and selecting finds things like GeoIP entries and checksum validation information. This affects the GTK+ UI as well. Change-Id: Ic81c0d8159510a72d30c41f961807d8a48d05e16 Reviewed-on: https://code.wireshark.org/review/4943 Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/byte_view_text.h')
-rw-r--r--ui/qt/byte_view_text.h22
1 files changed, 15 insertions, 7 deletions
diff --git a/ui/qt/byte_view_text.h b/ui/qt/byte_view_text.h
index 25f5a94c0e..d1b03278ca 100644
--- a/ui/qt/byte_view_text.h
+++ b/ui/qt/byte_view_text.h
@@ -53,14 +53,18 @@ public:
void setFieldHighlight(int start, int end, guint32 mask = 0, int mask_le = 0);
void setFieldAppendixHighlight(int start, int end);
+signals:
+ void byteFieldHovered(QString &);
+
public slots:
void setMonospaceFont(const QFont &mono_font);
protected:
virtual void paintEvent(QPaintEvent *);
virtual void resizeEvent(QResizeEvent *);
- void mousePressEvent (QMouseEvent * event);
-
+ virtual void mousePressEvent (QMouseEvent * event);
+ virtual void mouseMoveEvent (QMouseEvent * event);
+ virtual void leaveEvent(QEvent *event);
private:
typedef enum {
@@ -80,6 +84,7 @@ private:
int asciiPixels();
int totalPixels();
void updateScrollbars();
+ field_info *fieldAtPixel(QPoint &pos);
static const int separator_interval_;
tvbuff_t *tvb_;
@@ -94,14 +99,17 @@ private:
gboolean bold_highlight_;
-/* data */
+ // Data
packet_char_enc encoding_; // ASCII or EBCDIC
bytes_view_type format_; // bytes in hex or bytes as bits
-/* data-highlight */
- guint p_start_, p_end_; // Protocol
- guint f_start_, f_end_; // Field
- guint fa_start_, fa_end_; // Field appendix
+ // Data highlight
+ QPair<guint,guint> p_bound_;
+ QPair<guint,guint> f_bound_;
+ QPair<guint,guint> fa_bound_;
+ QPair<guint,guint> p_bound_save_;
+ QPair<guint,guint> f_bound_save_;
+ QPair<guint,guint> fa_bound_save_;
bool show_offset_; // Should we show the byte offset?
bool show_hex_; // Should we show the hex display?