[Gambas-devel] DrawingArea, SetFocus, BUG ?

Benoit Minisini gambas at ...1...
Sun Oct 24 16:02:13 CEST 2004


On Thursday 21 October 2004 13:38, Christian Faure wrote:
> Hi Benoit,
>
> Working on a ReportDesigner, i get somes problems:
>
> The IDE of ReportDesigner work creating and placing objects in a ScrollView
> using a toolbox and allow drag and drop to move objects.
>
> These objects are DrawingArea's
>
> I call a DrawingArea.SetFocus() function to enable each object to handle
> keyboard events.
>
> All work  ok, except when i  move an object outside of visible area and
> this object lose focus, then app crash with:
>      QPainter::begin: Cannot paint null pixmap
>      QPainter::setWorldMatrix: Will be reset by begin()
>
> Attached file provide a small example of the problem
>
> Thanks

I found the bug: when the drawing area is not visible, qt sends a paint event 
with a null width and height, which is a case I didn't test.

Here is a patch that solves the problem.

Regards,

-- 
Benoit Minisini
mailto:gambas at ...1...
-------------- next part --------------
A non-text attachment was scrubbed...
Name: CDrawingArea.cpp
Type: text/x-c++src
Size: 7350 bytes
Desc: not available
URL: <http://lists.gambas-basic.org/pipermail/devel/attachments/20041024/838f7f6b/attachment.cpp>


More information about the Devel mailing list