[umbrello] [Bug 424863] Feature request: Enable wrapping of long lines in use cases and parameter lists of operations
Robert Hairgrove
bugzilla_noreply at kde.org
Mon Aug 3 09:50:28 BST 2020
https://bugs.kde.org/show_bug.cgi?id=424863
--- Comment #4 from Robert Hairgrove <code at roberthairgrove.com> ---
OK, I have now implemented wrapping for use cases. But I want to work on
wrapping parameter lists in classes before I make a patch, which I consider to
be a much more serious defect.
It was very easy, involving changes to two functions:
void UseCaseWidget::paint() and UseCaseWidget::minimumSize().
In minimumSize, I had to change just one line:
int width = (textWidth / 3) > UC_WIDTH ? textWidth / 3 : UC_WIDTH;
This sets the minimum width to 1/3 of the text width which is a bit arbitrary,
but allows for wrapping at least three lines.
In the paint() function, the painter->drawText will also take hard breaks into
consideration if the Qt::TextWordWrap flag is set. So I merely added any
stereotype to the beginning of the other text and let drawText() take care of
it.
Also, I used QFontMetricsF instead of the version with int. It seems to give
better results at times due to less rounding errors.
--
You are receiving this mail because:
You are the assignee for the bug.
More information about the umbrello-devel
mailing list