![Gerald Combs](/assets/img/avatar_default.png)
Add a ProtoTreeModel and use it in ProtoTree. This should make the UI more responsive when we have lots of items in the tree. Change-Id: Id26e6bcff84663867a8da17fd9ae86ff639b633f Reviewed-on: https://code.wireshark.org/review/24774 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
70 lines
1.2 KiB
C++
70 lines
1.2 KiB
C++
/* proto_node.h
|
|
*
|
|
* Wireshark - Network traffic analyzer
|
|
* By Gerald Combs <gerald@wireshark.org>
|
|
* Copyright 1998 Gerald Combs
|
|
*
|
|
* SPDX-License-Identifier: GPL-2.0+
|
|
*/
|
|
|
|
#ifndef PROTO_NODE_H_
|
|
#define PROTO_NODE_H_
|
|
|
|
#include <config.h>
|
|
|
|
#include <ui/qt/utils/field_information.h>
|
|
|
|
class ProtoNode
|
|
{
|
|
public:
|
|
|
|
class ChildIterator {
|
|
public:
|
|
typedef struct _proto_node * NodePtr;
|
|
|
|
ChildIterator(NodePtr n = Q_NULLPTR);
|
|
|
|
bool hasNext();
|
|
ChildIterator next();
|
|
ProtoNode element();
|
|
|
|
protected:
|
|
NodePtr node;
|
|
};
|
|
|
|
explicit ProtoNode(proto_node * node = NULL);
|
|
|
|
bool isValid() const;
|
|
bool isChild() const;
|
|
bool isExpanded() const;
|
|
|
|
proto_node *protoNode() const;
|
|
int childrenCount() const;
|
|
int row();
|
|
ProtoNode parentNode();
|
|
|
|
QString labelText() const;
|
|
|
|
ChildIterator children() const;
|
|
|
|
private:
|
|
proto_node * node_;
|
|
static bool isHidden(proto_node * node);
|
|
};
|
|
|
|
|
|
#endif // PROTO_NODE_H_
|
|
|
|
/*
|
|
* Editor modelines
|
|
*
|
|
* Local Variables:
|
|
* c-basic-offset: 4
|
|
* tab-width: 8
|
|
* indent-tabs-mode: nil
|
|
* End:
|
|
*
|
|
* ex: set shiftwidth=4 tabstop=8 expandtab:
|
|
* :indentSize=4:tabSize=8:noTabs=true:
|
|
*/
|