CustusX  22.04-rc5
An IGT application
cxToolListWidget.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 
12 #ifndef CXTOOLLISTWIDGET_H_
13 #define CXTOOLLISTWIDGET_H_
14 
15 #include "cxGuiExport.h"
16 
17 #include <QListWidget>
18 #include "cxForwardDeclarations.h"
19 
20 class QDir;
21 class QListWidgetItem;
22 
23 namespace cx
24 {
36 class cxGui_EXPORT ToolListWidget : public QListWidget
37 {
38  Q_OBJECT
39 
40 public:
41  ToolListWidget(TrackingServicePtr trackingService, QWidget* parent = NULL);
42  virtual ~ToolListWidget();
43 
44 signals:
45  void toolSelected(QString absoluteFilePath);
46  void userChangedList();
47  void listSizeChanged();
48 
49 protected:
50  void populate(QStringList toolsAbsoluteFilePath);
51  void addTool(QString absoluteFilePath);
52 
54 
55 private slots:
56  void selectionChangedSlot();
57  void toolSelectedSlot(QListWidgetItem* item);
58 };
59 
60 //---------------------------------------------------------------------------------------------------------------------
61 
70 class cxGui_EXPORT FilteringToolListWidget : public ToolListWidget
71 {
72  Q_OBJECT
73 
74 public:
75  FilteringToolListWidget(TrackingServicePtr trackingService, QWidget* parent = NULL);
76  virtual ~FilteringToolListWidget();
77 
78  virtual QSize minimumSizeHint() const;
79 
80 public slots:
81  void filterSlot(QStringList applicationsFilter, QStringList trackingsystemsFilter);
82 
83 protected:
84  void mousePressEvent(QMouseEvent *event);
85  void mouseMoveEvent(QMouseEvent *event);
86  void startDrag();
87 
88 private:
89  QStringList filter(QStringList toolsToFilter, QStringList applicationsFilter, QStringList trackingsystemsFilter);
90  QPoint startPos;
91 };
92 
93 //---------------------------------------------------------------------------------------------------------------------
94 
103 class cxGui_EXPORT ConfigToolListWidget : public ToolListWidget
104 {
105  Q_OBJECT
106 
107 public:
108  ConfigToolListWidget(TrackingServicePtr trackingService, QWidget* parent = NULL);
109  virtual ~ConfigToolListWidget();
110 
111  virtual void dropEvent(QDropEvent* event);
112  QStringList getTools();
113 
114 public slots:
115  void configSlot(QStringList toolsAbsoluteFilePath);
116  void filterSlot(QStringList trackingsystemFilter);
117 
118 private slots:
119  void deleteSlot();
120  void deleteItemSlot(QListWidgetItem* item);
121  void contextMenuSlot(const QPoint & point);
122 
123 protected:
124  void dragEnterEvent(QDragEnterEvent *event);
125  void dragMoveEvent(QDragMoveEvent *event);
126 
127 private:
128  QListWidgetItem* mItemToDelete;
129 };
130 
131 } //namespace cx
132 #endif /* CXTOOLLISTWIDGET_H_ */
boost::shared_ptr< class TrackingService > TrackingServicePtr
Class for displaying tool files that can be dragged and droppedSuperclass, not used directly...
Helper class for tool config list display.
Helper class for tool list display.
TrackingServicePtr mTrackingService
Namespace for all CustusX production code.