Bounding rect question

Leonardo Giordani giordani.leonardo at gmail.com
Mon Jul 8 16:53:02 UTC 2013


In Clock::prepareFont()
(kde-workspace/plasma/generic/applets/digital-clock/clock.cpp) I find the
following code

tmpRect = fm.boundingRect(rect, flags, text);

which extracts the bounding rect of the given text written using the given
font. I do not understand why the function requires a QRect as input. The
documentation says:

"The drawing, and hence the bounding rectangle, is constrained to the
rectangle rect."

What does it mean? That the output rectangle cannot be smaller than the
given? Bigger?

Since the prepareFont() code loops decreasing the font until it fits the
given rect I would say that the output rect cannot be smaller than the
given one. Someone can confirm it or explain?

Thanks!


Leonardo Giordani
Author of The Digital Cat <http://lgiordani.github.com>
My profile on About.me <http://about.me/leonardo.giordani>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20130708/2ea90509/attachment.html>


More information about the Plasma-devel mailing list