[Qgis-developer] QgsMapCanvas::paintEvent() too frequent

Radim Blazek radim.blazek at gmail.com
Fri Jan 17 13:49:39 PST 2014


On Fri, Jan 17, 2014 at 9:22 PM, Tim Sutton <lists at linfiniti.com> wrote:
> Hi
>
> I doesn't actually redraw the map ten times though does it? It doesn't seem
> to for me....

It does not redraw the map but QgsMapCanvasMap does repaint cached,
previously rendered, mPixmap. That is probably fast (takes some time
anyway), but there are also all QgsMapCanvasItems. QgsHighlight for
example, which renders identified feature every time and that can be
heavy (as Régis pointed out) for complex polygons with thousands of
islands. That is how I came to it.

Radim

> Regards
>
> Tim
>
>
> On Fri, Jan 17, 2014 at 1:09 PM, Radim Blazek <radim.blazek at gmail.com>
> wrote:
>>
>> More observations.
>>
>> When mouse enters the map canvas, first 10 (unwanted?) paintEvents
>> are caused by QEvent::HoverMove. Following QEvent::HoverMove events
>> are not causing additional paintEvents.
>>
>> Single QEvent::HoverLeave is followed by 10 paintEvents (QEvent::Paint
>> - Screen update necessary).
>>
>> QEvent::WindowActivate (restore) is also followed by 10 additional (11
>> in total) paintEvents().
>>
>> Setting stylesheet, for example: setStyleSheet(":hover
>> {background-color: #ff0000;}");
>> increases the number of paintEvents to 20.
>>
>> Radim
>>
>> On Thu, Jan 16, 2014 at 8:53 PM, Radim Blazek <radim.blazek at gmail.com>
>> wrote:
>> > QgsMapCanvas::paintEvent() is called too frequently on my X11, for
>> > example:
>> > - 11 times when mouse enters map canvas (if QGIS does not have focus)
>> > - 10 times when mouse leaves map canvas
>> > - 13 times when minimized QGIS is restored
>> > etc.
>> >
>> > Does anybody know why and how it could be reduced?
>> >
>> > Radim
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
>
>
>
>
> --
> Tim Sutton - QGIS Project Steering Committee Member
> ==============================================
> Please do not email me off-list with technical
> support questions. Using the lists will gain
> more exposure for your issues and the knowledge
> surrounding your issue will be shared with all.
>
> Irc: timlinux on #qgis at freenode.net
> ==============================================


More information about the Qgis-developer mailing list