[Uml-devel] branches/work/soc-umbrello/umbrello
Gopala Krishna A
krishna.ggk at gmail.com
Wed Aug 27 17:25:13 UTC 2008
SVN commit 853408 by gopala:
1) Use QGraphicsSceneMouseEvent::scenePos() instead of pos(), the
latter is valid only for QGraphicsItems.
2) Fix crash due to absence of FloatingTextWidget (temporary fix).
M +11 -8 toolbarstatemessages.cpp
--- branches/work/soc-umbrello/umbrello/toolbarstatemessages.cpp #853407:853408
@@ -77,13 +77,14 @@
{
m_isObjectWidgetLine = false;
- ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->pos());
+ ObjectWidget* objectWidgetLine = m_pUMLScene->onWidgetLine(m_pMouseEvent->scenePos());
if (objectWidgetLine) {
+ qDebug() << Q_FUNC_INFO << "Object detected";
setCurrentWidget(objectWidgetLine);
m_isObjectWidgetLine = true;
return;
}
-
+ qDebug() << Q_FUNC_INFO << "Object NOT detected";
//commit 515177 fixed a setting creation messages only working properly at 100% zoom
//However, the applied patch doesn't seem to be necessary no more, so it was removed
//The widgets weren't got from UMLView, but from a method in this class similarto the
@@ -213,7 +214,7 @@
yclick = 0;
return;
}
- //TODO shouldn't start position in the first widget be used also for normal messages
+ //TODO shouldn't start position in the first widget be used also for normal messages
//and not only for creation?
qreal y = m_pMouseEvent->scenePos().y();
if (messageType == CreationMessage) {
@@ -231,12 +232,14 @@
m_pUMLScene->getMessageList().append(message);
FloatingTextWidget *ft = message->floatingTextWidget();
- //TODO cancel doesn't cancel the creation of the message, only cancels setting an operation.
- //Shouldn't it cancel also the whole creation?
- ft->showOperationDialog();
- message->setTextPosition();
- m_pUMLScene->getWidgetList().append(ft);
+ if (ft) {
+ //TODO cancel doesn't cancel the creation of the message, only cancels setting an operation.
+ //Shouldn't it cancel also the whole creation?
+ ft->showOperationDialog();
+ message->setTextPosition();
+ m_pUMLScene->getWidgetList().append(ft);
+ }
UMLApp::app()->getDocument()->setModified();
}
More information about the umbrello-devel
mailing list