case Qt::Key_Return:
case Qt::Key_Enter: {
// it start a new line creation at a free point
+ if(isValid())
restartOperation(feature()->getKind());
}
break;
{
if (theEvent->type() == QEvent::KeyRelease) {
QKeyEvent* aKeyEvent = dynamic_cast<QKeyEvent*>(theEvent);
- if(aKeyEvent) {
- onKeyReleased(aKeyEvent);
+ if(aKeyEvent && onKeyReleased(aKeyEvent)) {
return true;
}
}
}
}
-void XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent)
+bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent)
{
// Let the manager decide what to do with the given key combination.
ModuleBase_Operation* anOperation = currentOperation();
- bool isRestart = false;
+ bool isAccepted = true;
switch (theEvent->key()) {
case Qt::Key_Escape: {
onAbortOperation();
}
break;
default:
+ isAccepted = false;
break;
}
- if(anOperation)
+ if(anOperation) {
anOperation->keyReleased(theEvent->key());
+ }
+ return isAccepted;
}
void XGUI_OperationMgr::onWidgetActivated(ModuleBase_ModelWidget* theWidget)
/// SLOT, that is called by the key in the property panel is clicked.
/// \param theName the attribute name
/// \param theEvent the mouse event
- void onKeyReleased(QKeyEvent* theEvent);
+ bool onKeyReleased(QKeyEvent* theEvent);
/// SLOT, that reacts to the widget activation
/// \param theWidget an activated widget
{
PostponeMessageQtEvent* aPostponedEv = dynamic_cast<PostponeMessageQtEvent*>(theEvent);
if (aPostponedEv) {
-#ifdef _DEBUG
- std::cout << "XGUI_Workshop::event " << "Got PostponeMessageQtEvent" << std::endl;
- bool isMyThread = (QApplication::instance()->thread() == QThread::currentThread());
- std::cout << "XGUI_Workshop::event " << "I am in the Qt's thread: "
- << isMyThread << std::endl;
-#endif
boost::shared_ptr<Events_Message> aEventPtr = aPostponedEv->postponedMessage();
processEvent(aEventPtr);
return true;