D7010: KSqueezedTextLabel: call updateGeometry() when text changes

Henrik F. noreply at phabricator.kde.org
Thu Aug 10 16:57:37 UTC 2017


rkflx added a comment.


  Looking at the Qt docs, we see:
  
  > Call QWidget::updateGeometry() whenever the size hint, minimum size hint or size policy changes. This will cause a layout recalculation.
  
  To decide whether this is also meaningful for a squeezable label, a testcase would be good, though. Might even be a totally different issue.
  
  In fact, I tried adding a test for this when implementing the autotests in https://phabricator.kde.org/D7163 last week already, but got stuck:
  
  - What is the size policy of the containing widget?
  - How to enter the initial squeezed state?
  - If the text is already squeezed, is the label actually supposed to change geometry if the text changes?
  - What is exactly misbehaving, i.e. what is the expected and what is the observed behaviour?
  - How to test updateGeometry() (vs. adjustSize(), which seems to call sizeHint() directly)?
  
  Not sure if this helps, but hopefully we'll figure it out eventually.
  
  TL;DR: Could not reproduce, but fix might still be correct.

REVISION DETAIL
  https://phabricator.kde.org/D7010

To: brauch, cfeck, rkflx
Cc: dhaumann, aacid, #frameworks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kde-frameworks-devel/attachments/20170810/f224143b/attachment.html>


More information about the Kde-frameworks-devel mailing list