Bug 429181 - In sequence diagrams, selection markers are sometimes not removed
Summary: In sequence diagrams, selection markers are sometimes not removed
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: Git
Platform: Other Linux
: NOR major
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-16 09:14 UTC by Ralf Habacker
Modified: 2021-02-11 23:37 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 2.33.80 (KDE releases 21.03.80)


Attachments
screenshot showing unselected widgets (24.85 KB, image/png)
2020-11-16 09:14 UTC, Ralf Habacker
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Ralf Habacker 2020-11-16 09:14:56 UTC
Created attachment 133374 [details]
screenshot showing unselected widgets

STEPS TO REPRODUCE
1. start umbrello
2. add a sequence diagram
3. add objects and messages
4. select objects and messages 

OBSERVED RESULT
After processing the tasks in step 4. multiple times, selection markers are not removed although the related widget is unselected.

EXPECTED RESULT
The selection markers should be removed if a widget is unselected

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: openSUSE_Leap 15.1
KDE Frameworks Version: 5.55
Qt Version: 5.9.7

ADDITIONAL INFORMATION
This problem can be reproduced with builds from git master and the release/20.12 branch, but not with builds from the release/20.08 branch, which means that the cause is a change in the master branch.

This problem should be fixed before release 20.12.0.
Comment 1 Oliver Kellogg 2020-11-19 22:07:49 UTC
As far as I experimented, the sticking markers only seem to happen on the operation FloatingTexts of MessageWidgets.
Also when the sticking happens, QGraphicsObjectWrapper::itemChange() no longer fires (at least not for change == ItemSelectedChange && scene());
only UMLWidget::mousePressEvent() continues to get triggered.
Could it be that we have competition between QGraphicsObjectWrapper::itemChange and UMLWidget::mousePressEvent ?
Comment 2 Oliver Kellogg 2020-11-21 23:08:21 UTC
Git commit 87abeac31e59542eb60c1f08c2a0d4abfa29237a by Oliver Kellogg.
Committed on 21/11/2020 at 23:07.
Pushed by okellogg into branch 'master'.

umbrello/umlwidgets/umlwidget.cpp : Proposed fix for bug 429181
- In functions mousePressEvent and mouseReleaseEvent, on calling
  m_scene->selectedCount() leave argument filterText at default value
  (false).  Reason: On distinguishing single vs multi selection all
  selected FloatingTexts shall be considered.
- In function mouseReleaseEvent handling of m_resized == true call
  deselect(event).

M  +3    -2    umbrello/umlwidgets/umlwidget.cpp

https://invent.kde.org/sdk/umbrello/commit/87abeac31e59542eb60c1f08c2a0d4abfa29237a
Comment 3 Oliver Kellogg 2020-11-21 23:14:02 UTC
As far as I experimented, commit
https://invent.kde.org/sdk/umbrello/commit/87abeac31e59542eb60c1f08c2a0d4abfa29237a
fixes the problem.
However, it is hard to test all possible usage scenarios of diagram object selection.
I appreciate your verification.
Comment 4 Oliver Kellogg 2020-11-22 20:15:38 UTC
Git commit 97ed260f37ad4040bf9b78db1c1259a4b5d82022 by Oliver Kellogg.
Committed on 22/11/2020 at 20:15.
Pushed by okellogg into branch 'master'.

umbrello/umlscene.cpp followup to commit 87abeac fix for bug 429181
- In function clearSelected iterate over selectedItems() for calling
  WidgetBase::setSelected(false) on each item.

M  +7    -0    umbrello/umlscene.cpp

https://invent.kde.org/sdk/umbrello/commit/97ed260f37ad4040bf9b78db1c1259a4b5d82022