Medical Imaging Interaction Toolkit  2016.11.0
Medical Imaging Interaction Toolkit
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
berryQtSelectionProvider.h
Go to the documentation of this file.
1 /*===================================================================
2 
3 BlueBerry Platform
4 
5 Copyright (c) German Cancer Research Center,
6 Division of Medical and Biological Informatics.
7 All rights reserved.
8 
9 This software is distributed WITHOUT ANY WARRANTY; without
10 even the implied warranty of MERCHANTABILITY or FITNESS FOR
11 A PARTICULAR PURPOSE.
12 
13 See LICENSE.txt or http://www.mitk.org for details.
14 
15 ===================================================================*/
16 
17 #ifndef BERRYQTSELECTIONPROVIDER_H_
18 #define BERRYQTSELECTIONPROVIDER_H_
19 
21 
23 
24 #include <QItemSelectionModel>
25 #include <QItemSelection>
26 #include <QObject>
27 
28 namespace berry
29 {
30 
31 class BERRY_UI_QT QtSelectionProvider: public QObject,
32  public ISelectionProvider
33 {
34  Q_OBJECT
35 
36 public:
37 
39 
41 
42  void AddSelectionChangedListener(ISelectionChangedListener* listener) override;
43 
44  void RemoveSelectionChangedListener(ISelectionChangedListener* listener) override;
45 
46  ISelection::ConstPointer GetSelection() const override;
47  void SetSelection(const ISelection::ConstPointer& selection) override;
48 
49  virtual void SetSelection(const ISelection::ConstPointer& selection,
50  QItemSelectionModel::SelectionFlags);
51 
52  QItemSelection GetQItemSelection() const;
53  void SetQItemSelection(const QItemSelection& selection);
54 
55  QItemSelectionModel* GetItemSelectionModel() const;
56  void SetItemSelectionModel(QItemSelectionModel* combo);
57 
58 protected:
60  QItemSelectionModel* qSelectionModel;
61 
62 protected slots:
63 
64  virtual void FireSelectionChanged(const QItemSelection& selected, const QItemSelection& deselected);
65 
66 };
67 
68 }
69 
70 #endif /* BERRYQTSELECTIONPROVIDER_H_ */
QItemSelectionModel * qSelectionModel
ISelectionChangedListener::Events selectionEvents
#define berryObjectMacro(...)
Definition: berryMacros.h:37
#define BERRY_UI_QT