Libkleo

treewidget.h
1/*
2 ui/treewidget.h
3
4 This file is part of libkleopatra
5 SPDX-FileCopyrightText: 2022 g10 Code GmbH
6 SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
7
8 SPDX-License-Identifier: GPL-2.0-or-later
9*/
10
11#pragma once
12
13#include "kleo_export.h"
14
15#include <QTreeWidget>
16
17namespace Kleo
18{
19
20/**
21 * A tree widget that allows accessible column by column keyboard navigation
22 * and that has customizable columns through a context menu in the header.
23 *
24 * This is the QTreeWidget-derived variant of TreeView.
25 *
26 * \sa TreeView
27 */
28class KLEO_EXPORT TreeWidget : public QTreeWidget
29{
30 Q_OBJECT
31public:
32 TreeWidget(QWidget *parent = nullptr);
33 ~TreeWidget() override;
34
35 /**
36 * Restores the layout state under key @p stateGroupName and enables state
37 * saving when the object is destroyed. Make sure that @p stateGroupName is
38 * unique for each place the widget occurs. Returns true if some state was
39 * restored. If false is returned, no state was restored and the caller should
40 * apply the default configuration.
41 */
42 bool restoreColumnLayout(const QString &stateGroupName);
43Q_SIGNALS:
44 void columnEnabled(int column);
45 void columnDisabled(int column);
46
47protected:
48 bool eventFilter(QObject *watched, QEvent *event) override;
49
50 QModelIndex moveCursor(QAbstractItemView::CursorAction cursorAction, Qt::KeyboardModifiers modifiers) override;
51
52private:
53 class Private;
54 const std::unique_ptr<Private> d;
55};
56
57}
A tree widget that allows accessible column by column keyboard navigation and that has customizable c...
Definition treewidget.h:29
typedef KeyboardModifiers
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri May 3 2024 11:44:55 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.