Fraxinus  2023.01.05-dev+develop.0da12
An IGT application
cxBrowserWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 This file is part of CustusX, an Image Guided Therapy Application.
3 
4 Copyright (c) SINTEF Department of Medical Technology.
5 All rights reserved.
6 
7 CustusX is released under a BSD 3-Clause license.
8 
9 See Lisence.txt (https://github.com/SINTEFMedtek/CustusX/blob/master/License.txt) for details.
10 =========================================================================*/
11 #ifndef CXBROWSERWIDGET_H_
12 #define CXBROWSERWIDGET_H_
13 
14 #include "cxBaseWidget.h"
15 #include "cxForwardDeclarations.h"
16 #include "cxPopupToolbarWidget.h"
17 #include "cxXmlOptionItem.h"
18 #include "cxControllableSplitter.h"
20 
21 class QTreeWidget;
22 class QVBoxLayout;
23 class QTreeWidgetItem;
24 class QTreeView;
25 class QSplitter;
26 class QLineEdit;
27 
28 namespace cx
29 {
30 
31 class PopupToolbarWidget;
32 class TreeItemModel;
33 class EraseDataToolButton;
34 typedef boost::shared_ptr<class TreeNode> TreeNodePtr;
35 typedef boost::shared_ptr<class TreeRepository> TreeRepositoryPtr;
36 
37 
48 class BrowserWidget : public BaseWidget
49 {
50  Q_OBJECT
51 
52 public:
53  BrowserWidget(QWidget* parent, VisServicesPtr services);
55 
56 protected slots:
57  void resetView(); // called when tree is reset
58 
59 protected:
61  QPointer<QTreeView> mTreeView;
62 
63 protected:
64  virtual void prePaintEvent();
65 
66 private:
67  void createGUI();
68  void onPopup();
69  void onCurrentItemChanged();
70  void createButtonWidget(QWidget* widget);
71  XmlOptionItem getShowToolbarOption();
72  void expandDefault(QModelIndex index);
73  void updateNodeName();
74  void eraseCurrentNode();
75  void onLoaded();
76  void onNodeCollapsed(const QModelIndex & index);
77  void onNodeExpanded(const QModelIndex & index);
78  void expandRestore(QModelIndex index);
79  bool setCurrentNode(QString uid, QModelIndex index);
80 
81  VisServicesPtr mServices;
82  ControllableSplitter* mSplitter;
83  QPointer<ReplacableContentWidget> mPropertiesWidget;
84  PopupToolbarWidget* mPopupWidget;
85  XmlOptionFile mOptions;
86  QLineEdit* mName;
87  EraseDataToolButton* mRemoveButton;
88 
89  StringPropertyPtr mFilterSelector;
90  QList<QString> mExpanded;
91  QString mActiveNodeUid;
92 };
93 }//end namespace cx
94 
95 #endif /* CXBROWSERWIDGET_H_ */
TreeItemModel * mModel
boost::shared_ptr< class TreeRepository > TreeRepositoryPtr
boost::shared_ptr< TreeNode > TreeNodePtr
BrowserWidget(QWidget *parent, VisServicesPtr services)
boost::shared_ptr< class VisServices > VisServicesPtr
Definition: cxMainWindow.h:40
Shows a treestructure containing the loaded images, meshes and tools.
Helper class for storing one string value in an xml document.
virtual void prePaintEvent()
boost::shared_ptr< class StringProperty > StringPropertyPtr
QPointer< QTreeView > mTreeView
Interface for QWidget which handles widgets uniformly for the system.
Definition: cxBaseWidget.h:88
Helper class for xml files used to store ssc/cx data.
Namespace for all CustusX production code.