MCPcopy Create free account
hub / github.com/MITK/MITK / eventFilter

Method eventFilter

Modules/QtWidgets/src/QmitkSingleNodeSelectionWidget.cpp:91–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89}
90
91bool QmitkSingleNodeSelectionWidget::eventFilter(QObject *obj, QEvent *ev)
92{
93 if (obj == m_Controls->btnSelect)
94 {
95 if (ev->type() == QEvent::MouseButtonRelease)
96 {
97 auto mouseEv = dynamic_cast<QMouseEvent*>(ev);
98 if (!mouseEv)
99 {
100 return false;
101 }
102
103 if (mouseEv->button() == Qt::LeftButton)
104 {
105 if (this->isEnabled())
106 {
107 this->EditSelection();
108 return true;
109 }
110 }
111 else
112 {
113 auto selection = this->CompileEmitSelection();
114 if (!selection.empty())
115 {
116 QmitkNodeDetailsDialog infoDialog(selection, this);
117 infoDialog.exec();
118 return true;
119 }
120 }
121 }
122 }
123
124 return false;
125}
126
127void QmitkSingleNodeSelectionWidget::EditSelection()
128{

Callers

nothing calls this directly

Calls 5

EditSelectionMethod · 0.95
typeMethod · 0.80
isEnabledMethod · 0.80
CompileEmitSelectionMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected