Details
-
Bug
-
Resolution: Fixed
-
P4: Low
-
6.5.2
-
-
7a24a59db (dev), 22d1beb74 (dev), c781403e5 (6.5), f441778f0 (6.5)
Description
The documentation for the QPainter.drawText function has this text:
The boundingRect (if not null) is set to the what the bounding rectangle should be in order to enclose the whole text. For example, in the following image, the dotted line represents boundingRect as calculated by the function, and the dashed line represents rectangle:
This appears to be copied directly from the C++ documentation, and the code sample given is a direct translation of the C++ code sample to Python.
In fact, this API does not accept boundingRect as an output parameter (and in fact Python best practice doesn't include using output parameters). Instead, it returns a QRect. The documentation says that the return value is None, including documentation within the module itself (accessible via Python help()).
The same is true of every overload of drawText on that page, and may well be true for other functions that take output parameters in C++.