| 111 | } |
| 112 | |
| 113 | void QmitkPopupColorChooser::closeEvent(QCloseEvent *e) |
| 114 | { |
| 115 | e->accept(); |
| 116 | |
| 117 | releaseKeyboard(); |
| 118 | releaseMouse(); |
| 119 | |
| 120 | if (!m_popupParent) |
| 121 | return; |
| 122 | |
| 123 | // remember that we (as a popup) might receive the mouse release |
| 124 | // event instead of the popupParent. This is due to the fact that |
| 125 | // the popupParent popped us up in its mousePressEvent handler. To |
| 126 | // avoid the button remaining in pressed state we simply send a |
| 127 | // faked mouse button release event to it. |
| 128 | // Maleike: parent should not pop us on MouseRelease! |
| 129 | QMouseEvent me(QEvent::MouseButtonRelease, QPoint(0, 0), QPoint(0, 0), Qt::LeftButton, Qt::NoButton, Qt::NoModifier); |
| 130 | QApplication::sendEvent(m_popupParent, &me); |
| 131 | } |
| 132 | |
| 133 | void QmitkPopupColorChooser::popup(QWidget *parent, const QPoint &point, const mitk::Color *color) |
| 134 | { |