Medical Imaging Interaction Toolkit  2026.06.00
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 QmitkNodeSelectionButton_h
14 #define QmitkNodeSelectionButton_h
15 
16 #include <MitkQtWidgetsExports.h>
17 
18 #include <mitkDataNode.h>
19 
20 #include <QPushButton>
21 #include <QPixmap>
22 
30 {
31  Q_OBJECT
32 
33 public:
34  explicit QmitkNodeSelectionButton(QWidget *parent = nullptr);
36 
40  bool GetSelectionIsOptional() const;
41 
42 public Q_SLOTS:
47  virtual void SetSelectedNode(const mitk::DataNode* node);
52  virtual void SetNodeInfo(QString info);
53 
58  void SetSelectionIsOptional(bool isOptional);
59 
60 protected:
61  void paintEvent(QPaintEvent *p) override;
62  void changeEvent(QEvent *event) override;
63 
66  void OnNodeModified(const itk::Object * /*caller*/, const itk::EventObject &);
67 
68  mitk::DataNode::ConstPointer m_SelectedNode;
69  QString m_Info;
71  QPixmap m_ThumbNail;
72  itk::ModifiedTimeType m_DataMTime;
73  itk::ModifiedTimeType m_SelectionPropMTime;
74 
76 
79 };
80 
81 #endif
#define MITKQTWIDGETS_EXPORT
Button class that can be used to display information about a given node. If the given node is a nullp...
const mitk::DataNode * GetSelectedNode() const
Returns the currently selected data node, or nullptr if none is selected.
void changeEvent(QEvent *event) override
~QmitkNodeSelectionButton() override
itk::ModifiedTimeType m_DataMTime
virtual void SetNodeInfo(QString info)
Sets the info text that is shown when no node is selected.
bool GetSelectionIsOptional() const
Returns whether the selection is optional.
void OnNodeModified(const itk::Object *, const itk::EventObject &)
QmitkNodeSelectionButton(QWidget *parent=nullptr)
virtual void SetSelectedNode(const mitk::DataNode *node)
Sets the node to display.
void paintEvent(QPaintEvent *p) override
void SetSelectionIsOptional(bool isOptional)
mitk::DataNode::ConstPointer m_SelectedNode
itk::ModifiedTimeType m_SelectionPropMTime
Central node class of the MITK data tree, associating a data object with properties and mappers.
Definition: mitkDataNode.h:72