1 /* tabnav_tree_view.h 2 * Tree view with saner tab navigation functionality. 3 * 4 * Copyright 2016 Peter Wu <peter@lekensteyn.nl> 5 * 6 * Wireshark - Network traffic analyzer 7 * By Gerald Combs <gerald@wireshark.org> 8 * Copyright 1998 Gerald Combs 9 * 10 * SPDX-License-Identifier: GPL-2.0-or-later 11 */ 12 13 #ifndef TABNAV_TREE_VIEW_H 14 #define TABNAV_TREE_VIEW_H 15 16 #include <config.h> 17 #include <QTreeView> 18 19 /** 20 * Like QTreeView, but instead of changing to the next row (same column) when 21 * pressing Tab while editing, change to the next column (same row). 22 */ 23 class TabnavTreeView : public QTreeView 24 { 25 Q_OBJECT 26 27 public: 28 TabnavTreeView(QWidget *parent = 0); 29 QModelIndex moveCursor(CursorAction cursorAction, Qt::KeyboardModifiers modifiers); 30 31 protected slots: 32 void currentChanged(const QModelIndex ¤t, const QModelIndex &previous); 33 34 signals: 35 void currentItemChanged(const QModelIndex ¤t, const QModelIndex &previous); 36 }; 37 #endif // TABNAV_TREE_VIEW_H 38