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

Radim Blazek radim.blazek at gmail.com
Fri Jan 17 03:09:43 PST 2014

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.


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

More information about the Qgis-developer mailing list