One user reported today that after placing multiple classes in a class diagram, adding associations will sometimes no longer work without further hints or error messages. STEPS TO REPRODUCE not reproducable yet OBSERVED RESULT The requested association is not added to the diagram EXPECTED RESULT The requested association should be added to the diagram SOFTWARE/OS VERSIONS Windows: 7 ADDITIONAL INFORMATION
Today I got the same error with a component diagram. After selecting the first widget clicking on the second widget do not connect both widgets. In a debug session it turned out that in the error case UMLScene::widgetAt(m_pMouseEvent->scenePos()) did not return the second widget in void ToolBarState::setCurrentElement() { ... // Check widgets. UMLWidget *widget = m_pUMLScene->widgetAt(m_pMouseEvent->scenePos()); if (widget) { setCurrentWidget(widget); return; } }
STEPS TO REPRODUCE 1. start umbrello 2. add two classes 3. move second widget 4. add an association from first to second widget OBSERVED RESULT The requested association is not added to the diagram EXPECTED RESULT The requested association should be added to the diagram
In normal case UMLWidget* UMLScene::widgetAt(const QPointF& p) returns correct widget instances 1. click ClassifierWidget(0x1e64b40) 2. click ClassifierWidget(0x1d14670) In the error case there is returned: 1. click ClassifierWidget(this = 0x1d14680) 2. click QGraphicsItem (0x15fdad0) which obviously isn't the right widget.
Git commit 3921d117b7b6dba3a7860e35b7266bc49d2a02b4 by Ralf Habacker. Committed on 25/11/2019 at 15:46. Pushed by habacker into branch 'release/19.12'. Fix 'Associations are sometime not addable in class diagram' On error, itemAt() returned the graphical element for the visual connection, not the selected widget. BUG:409631 FIXED-IN:2.29.90 (KDE Applications 19.11.90) M +11 -6 umbrello/umlscene.cpp https://invent.kde.org/kde/umbrello/commit/3921d117b7b6dba3a7860e35b7266bc49d2a02b4