pqTreeView.h
Go to the documentation of this file.
1 // SPDX-FileCopyrightText: Copyright (c) Kitware Inc.
2 // SPDX-FileCopyrightText: Copyright (c) Sandia Corporation
3 // SPDX-License-Identifier: BSD-3-Clause
4 #ifndef pqTreeView_h
5 #define pqTreeView_h
6 
7 #include "pqWidgetsModule.h"
8 #include <QTreeView>
9 
34 class PQWIDGETS_EXPORT pqTreeView : public QTreeView
35 {
36  Q_OBJECT
37 
43  Q_PROPERTY(int maximumRowCountBeforeScrolling READ maximumRowCountBeforeScrolling WRITE
44  setMaximumRowCountBeforeScrolling)
45 
46  typedef QTreeView Superclass;
47 
48 public:
49  pqTreeView(QWidget* parent = nullptr, bool use_pqHeaderView = false);
50  ~pqTreeView() override = default;
51 
52  bool eventFilter(QObject* object, QEvent* e) override;
53 
57  void wheelEvent(QWheelEvent* event) override;
58 
59  void setModel(QAbstractItemModel* model) override;
60  void setRootIndex(const QModelIndex& index) override;
61 
62  QSize sizeHint() const override;
63  QSize minimumSizeHint() const override;
64 
65  void setMaximumRowCountBeforeScrolling(int val) { this->MaximumRowCountBeforeScrolling = val; }
66  int maximumRowCountBeforeScrolling() const { return this->MaximumRowCountBeforeScrolling; }
67 
73  void setupCustomHeader(bool use_pqHeaderView = false);
74 
75 protected:
77 
92  QItemSelectionModel::SelectionFlags selectionCommand(
93  const QModelIndex& index, const QEvent* event = nullptr) const override;
94  bool edit(const QModelIndex& index, EditTrigger trigger, QEvent* event) override;
96 
97 private Q_SLOTS:
98  void invalidateLayout();
99 
100 private: // NOLINT(readability-redundant-access-specifiers)
101  int ScrollPadding;
102  int MaximumRowCountBeforeScrolling;
103 };
104 
105 #endif
int maximumRowCountBeforeScrolling() const
Definition: pqTreeView.h:66
: QTreeView subclass that add ParaView specific customizations.
Definition: pqTreeView.h:34
#define PQWIDGETS_EXPORT
void setMaximumRowCountBeforeScrolling(int val)
Definition: pqTreeView.h:65
index