Wireshark mailing list archives

Re: Qt - Protocol dissector


From: Edwin Groothuis <Edwin.Groothuis () riverbed com>
Date: Tue, 31 May 2016 04:16:31 +0000

On 5/17/16 7:18 AM, Edwin Groothuis wrote:
I hope that somebody can give me a quick pointer:
In ui/qt/proto_tree.cpp in the ProtoTree class, how can I get access to the
current selected protocol? In the below example, TCP.

I’ve stared at various files for a long time but it doesn’t click... Who
can help?

Each protocol tree item has a field_info pointer associated to it via QTreeWidgetItem::setData(0, Qt::UserRole). You 
can fetch the pointer using QTreeWidgetItem::data. See ProtoTree::contextMenuEvent and 
ProtoTree::updateSelectionStatus for examples.

Believe it or not, but I managed to get the data via the functions suggested. Thanks!

Edwin
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: