A TreeView to display mesh element properties.
Definition at line 23 of file ElementTreeView.h.
#include <ElementTreeView.h>
|
void | selectionChanged (const QItemSelection &selected, const QItemSelection &deselected) override |
| Is called when the selection of this view changes.
|
|
◆ ElementTreeView()
ElementTreeView::ElementTreeView |
( |
QWidget * | parent = nullptr | ) |
|
|
explicit |
◆ nodeSelected
void ElementTreeView::nodeSelected |
( |
vtkUnstructuredGridAlgorithm const * const | , |
|
|
unsigned | , |
|
|
bool | ) |
|
signal |
◆ removeSelectedMeshComponent
void ElementTreeView::removeSelectedMeshComponent |
( |
| ) |
|
|
signal |
◆ selectionChanged
void ElementTreeView::selectionChanged |
( |
const QItemSelection & | selected, |
|
|
const QItemSelection & | deselected ) |
|
overrideprotectedslot |
Is called when the selection of this view changes.
Definition at line 38 of file ElementTreeView.cpp.
40{
41 Q_UNUSED(deselected);
42 if (!selected.isEmpty())
43 {
45 const QModelIndex idx = *(selected.indexes().begin());
46
47 if (idx.parent().isValid())
48 {
49 if (idx.parent().parent().isValid())
50 {
52 static_cast<TreeModel*
>(this->model())->getItem(idx);
53 const unsigned node_index =
54 tree_item->
data(0).toString().mid(5).toUInt();
57 node_index, false);
58 }
59 }
60 }
61}
A model for the display of information concerning element information implemented as a TreeModel.
void nodeSelected(vtkUnstructuredGridAlgorithm const *const, unsigned, bool)
void removeSelectedMeshComponent()
Objects nodes for the TreeModel.
virtual QVariant data(int column) const
A hierarchical model for a tree implemented as a double-linked list.
References TreeItem::data(), nodeSelected(), and removeSelectedMeshComponent().
◆ updateView
void ElementTreeView::updateView |
( |
| ) |
|
|
slot |
Definition at line 25 of file ElementTreeView.cpp.
26{
27 setAlternatingRowColors(true);
28 setColumnWidth(0, 150);
29 std::size_t nColumns =
30 (this->model() != nullptr) ? this->model()->columnCount() : 0;
31 for (std::size_t i = 1; i < nColumns; i++)
32 {
33 resizeColumnToContents(i);
34 }
35 this->expandAll();
36}
The documentation for this class was generated from the following files: