src
gui
include
corbo-gui
extended_tree_widget.h
Go to the documentation of this file.
1
/*********************************************************************
2
*
3
* Software License Agreement
4
*
5
* Copyright (c) 2020,
6
* TU Dortmund - Institute of Control Theory and Systems Engineering.
7
* All rights reserved.
8
*
9
* This program is free software: you can redistribute it and/or modify
10
* it under the terms of the GNU General Public License as published by
11
* the Free Software Foundation, either version 3 of the License, or
12
* (at your option) any later version.
13
*
14
* This program is distributed in the hope that it will be useful,
15
* but WITHOUT ANY WARRANTY; without even the implied warranty of
16
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
* GNU General Public License for more details.
18
*
19
* You should have received a copy of the GNU General Public License
20
* along with this program. If not, see <https://www.gnu.org/licenses/>.
21
*
22
* Authors: Christoph Rösmann
23
*********************************************************************/
24
25
#ifndef SRC_GUI_INCLUDE_CORBO_GUI_EXTENDED_TREE_WIDGET_H_
26
#define SRC_GUI_INCLUDE_CORBO_GUI_EXTENDED_TREE_WIDGET_H_
27
28
#include <QTreeWidget>
29
30
namespace
corbo
{
31
namespace
gui {
32
33
// the common tree widget does not support deselection of items when clicking somewhere else in the widget
34
// Hence, we add this functionality:
35
class
ExtendedTreeWidget
:
public
QTreeWidget
36
{
37
Q_OBJECT
38
39
public
:
40
explicit
ExtendedTreeWidget
(QWidget* parent =
nullptr
);
41
virtual
~ExtendedTreeWidget
() {}
42
43
QSize
sizeHint
()
const override
;
44
45
public
slots:
46
void
updateSizeHint
() { updateGeometry(); }
47
48
protected
:
49
int
recursiveHeightHint
(QTreeWidgetItem* item)
const
;
50
51
private
:
52
void
mousePressEvent
(QMouseEvent* event)
override
;
53
};
54
55
}
// namespace gui
56
}
// namespace corbo
57
58
#endif // SRC_GUI_INCLUDE_CORBO_GUI_EXTENDED_TREE_WIDGET_H_
corbo::gui::ExtendedTreeWidget::~ExtendedTreeWidget
virtual ~ExtendedTreeWidget()
Definition:
extended_tree_widget.h:41
corbo::gui::ExtendedTreeWidget::sizeHint
QSize sizeHint() const override
Definition:
extended_tree_widget.cpp:44
corbo::gui::ExtendedTreeWidget::updateSizeHint
void updateSizeHint()
Definition:
extended_tree_widget.h:46
corbo::gui::ExtendedTreeWidget
Definition:
extended_tree_widget.h:35
corbo
Definition:
communication/include/corbo-communication/utilities.h:37
corbo::gui::ExtendedTreeWidget::ExtendedTreeWidget
ExtendedTreeWidget(QWidget *parent=nullptr)
Definition:
extended_tree_widget.cpp:33
corbo::gui::ExtendedTreeWidget::mousePressEvent
void mousePressEvent(QMouseEvent *event) override
Definition:
extended_tree_widget.cpp:85
corbo::gui::ExtendedTreeWidget::recursiveHeightHint
int recursiveHeightHint(QTreeWidgetItem *item) const
Definition:
extended_tree_widget.cpp:56
control_box_rst
Author(s): Christoph Rösmann
autogenerated on Mon Feb 28 2022 22:06:51