curvetree_view.h
Go to the documentation of this file.
1 /*
2  * This Source Code Form is subject to the terms of the Mozilla Public
3  * License, v. 2.0. If a copy of the MPL was not distributed with this
4  * file, You can obtain one at https://mozilla.org/MPL/2.0/.
5  */
6 
7 #ifndef CURVETREE_VIEW_H
8 #define CURVETREE_VIEW_H
9 
10 #include "curvelist_view.h"
11 #include <QTreeWidget>
12 #include <functional>
13 
14 class CurveTreeView : public QTreeWidget, public CurvesView
15 {
16 public:
18 
19  void clear() override;
20 
21  void addItem(const QString& prefix, const QString& tree_name,
22  const QString& plot_ID) override;
23 
24  void refreshColumns() override;
25 
26  std::vector<std::string> getSelectedNames() override;
27 
28  void refreshFontSize() override;
29 
30  bool applyVisibilityFilter(const QString& filter_string) override;
31 
32  bool eventFilter(QObject* object, QEvent* event) override;
33 
34  void removeCurve(const QString& name) override;
35 
36  std::pair<int, int> hiddenItemsCount() override
37  {
38  return { _hidden_count, _leaf_count };
39  }
40 
41  void setViewResizeEnabled(bool) override
42  {
43  }
44 
45  virtual void hideValuesColumn(bool hide) override;
46 
47  void treeVisitor(std::function<void(QTreeWidgetItem*)> visitor);
48 
49  virtual void keyPressEvent(QKeyEvent*) override;
50 
51 private:
52  void expandChildren(bool expanded, QTreeWidgetItem* item);
53 
54  int _hidden_count = 0;
55  int _leaf_count = 0;
56 
57  QTimer* _tooltip_timer = nullptr;
58  QTreeWidgetItem* _tooltip_item = nullptr;
59  QPoint _tooltip_pos;
60 };
61 
62 #endif // CURVETREE_VIEW_H
CurveTreeView::eventFilter
bool eventFilter(QObject *object, QEvent *event) override
Definition: curvetree_view.cpp:302
CurveTreeView::_tooltip_timer
QTimer * _tooltip_timer
Definition: curvetree_view.h:57
CurveTreeView::keyPressEvent
virtual void keyPressEvent(QKeyEvent *) override
Definition: curvetree_view.cpp:386
CurveTreeView::addItem
void addItem(const QString &prefix, const QString &tree_name, const QString &plot_ID) override
Definition: curvetree_view.cpp:95
CurvesView
Definition: curvelist_view.h:51
CurveTreeView::expandChildren
void expandChildren(bool expanded, QTreeWidgetItem *item)
Definition: curvetree_view.cpp:399
CurveTreeView
Definition: curvetree_view.h:14
CurveListPanel
Definition: curvelist_panel.h:29
CurveTreeView::_tooltip_pos
QPoint _tooltip_pos
Definition: curvetree_view.h:59
CurveTreeView::_tooltip_item
QTreeWidgetItem * _tooltip_item
Definition: curvetree_view.h:58
CurveTreeView::hiddenItemsCount
std::pair< int, int > hiddenItemsCount() override
Definition: curvetree_view.h:36
CurveTreeView::refreshColumns
void refreshColumns() override
Definition: curvetree_view.cpp:196
CurveTreeView::setViewResizeEnabled
void setViewResizeEnabled(bool) override
Definition: curvetree_view.h:41
CurveTreeView::applyVisibilityFilter
bool applyVisibilityFilter(const QString &filter_string) override
Definition: curvetree_view.cpp:232
CurveTreeView::treeVisitor
void treeVisitor(std::function< void(QTreeWidgetItem *)> visitor)
Definition: curvetree_view.cpp:369
CurveTreeView::refreshFontSize
void refreshFontSize() override
Definition: curvetree_view.cpp:214
CurveTreeView::_leaf_count
int _leaf_count
Definition: curvetree_view.h:55
CurveTreeView::hideValuesColumn
virtual void hideValuesColumn(bool hide) override
Definition: curvetree_view.cpp:363
CurveTreeView::getSelectedNames
std::vector< std::string > getSelectedNames() override
Definition: curvetree_view.cpp:203
CurveTreeView::_hidden_count
int _hidden_count
Definition: curvetree_view.h:54
curvelist_view.h
CurveTreeView::removeCurve
void removeCurve(const QString &name) override
Definition: curvetree_view.cpp:331
CurveTreeView::CurveTreeView
CurveTreeView(CurveListPanel *parent)
Definition: curvetree_view.cpp:31
CurveTreeView::clear
void clear() override
Definition: curvetree_view.cpp:86


plotjuggler
Author(s): Davide Faconti
autogenerated on Mon Nov 11 2024 03:23:43