Medical Imaging Interaction Toolkit  2018.4.99-7e02155b
Medical Imaging Interaction Toolkit
berryQtSelectionProvider.h
Go to the documentation of this file.
1 /*============================================================================
2 
3 The Medical Imaging Interaction Toolkit (MITK)
4 
5 Copyright (c) German Cancer Research Center (DKFZ)
6 All rights reserved.
7 
8 Use of this source code is governed by a 3-clause BSD license that can be
9 found in the LICENSE file.
10 
11 ============================================================================*/
12 
13 #ifndef BERRYQTSELECTIONPROVIDER_H_
14 #define BERRYQTSELECTIONPROVIDER_H_
15 
17 
19 
20 #include <QItemSelectionModel>
21 #include <QItemSelection>
22 #include <QObject>
23 
24 namespace berry
25 {
26 
27 class BERRY_UI_QT QtSelectionProvider: public QObject,
28  public ISelectionProvider
29 {
30  Q_OBJECT
31 
32 public:
33 
35 
37 
38  void AddSelectionChangedListener(ISelectionChangedListener* listener) override;
39 
40  void RemoveSelectionChangedListener(ISelectionChangedListener* listener) override;
41 
42  ISelection::ConstPointer GetSelection() const override;
43  void SetSelection(const ISelection::ConstPointer& selection) override;
44 
45  virtual void SetSelection(const ISelection::ConstPointer& selection,
46  QItemSelectionModel::SelectionFlags);
47 
48  QItemSelection GetQItemSelection() const;
49  void SetQItemSelection(const QItemSelection& selection);
50 
51  QItemSelectionModel* GetItemSelectionModel() const;
52  void SetItemSelectionModel(QItemSelectionModel* combo);
53 
54 protected:
56  QItemSelectionModel* qSelectionModel;
57 
58 protected slots:
59 
60  virtual void FireSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
61 
62 };
63 
64 }
65 
66 #endif /* BERRYQTSELECTIONPROVIDER_H_ */
QItemSelectionModel * qSelectionModel
ISelectionChangedListener::Events selectionEvents
#define berryObjectMacro(...)
Definition: berryMacros.h:33
#define BERRY_UI_QT