Medical Imaging Interaction Toolkit  2022.04.99-01b95b17
Medical Imaging Interaction Toolkit
QmitkNodeSelectionButton.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 QMITK_NODE_SELECTION_BUTTON_H
14 #define QMITK_NODE_SELECTION_BUTTON_H
15 
17 
18 #include <mitkDataNode.h>
19 
20 #include <QPushButton>
21 #include <QPixmap>
22 
29 class MITK_QT_COMMON QmitkNodeSelectionButton : public QPushButton
30 {
31  Q_OBJECT
32 
33 public:
34  explicit QmitkNodeSelectionButton(QWidget *parent = nullptr);
35  ~QmitkNodeSelectionButton() override;
36 
37  const mitk::DataNode* GetSelectedNode() const;
38  bool GetSelectionIsOptional() const;
39 
40 public Q_SLOTS:
41  virtual void SetSelectedNode(const mitk::DataNode* node);
42  virtual void SetNodeInfo(QString info);
43 
48  void SetSelectionIsOptional(bool isOptional);
49 
50 protected:
51  void paintEvent(QPaintEvent *p) override;
52  void changeEvent(QEvent *event) override;
53 
54  void AddNodeObserver();
55  void RemoveNodeObserver();
56  void OnNodeModified(const itk::Object * /*caller*/, const itk::EventObject &);
57 
59  QString m_Info;
61  QPixmap m_ThumbNail;
62  itk::ModifiedTimeType m_DataMTime;
63  itk::ModifiedTimeType m_SelectionPropMTime;
64 
66 
69 };
70 
71 #endif // QMITK_NODE_SELECTION_BUTTON_H
itk::ModifiedTimeType m_SelectionPropMTime
itk::ModifiedTimeType m_DataMTime
mitk::DataNode::ConstPointer m_SelectedNode
#define MITK_QT_COMMON
Button class that can be used to display information about a given node. If the given node is a nullp...
Class for nodes of the DataTree.
Definition: mitkDataNode.h:63