[Qgis-developer] Possible bug with QgsRubberBand refreshing

Anatoliy Golubev darth.naihil at gmail.com
Tue Mar 17 09:17:20 PDT 2015


Ok, opened a ticket: https://hub.qgis.org/issues/12392

2015-03-17 18:47 GMT+03:00 Matthias Kuhn <matthias at opengis.ch>:
> On 03/17/2015 03:50 PM, Anatoliy Golubev wrote:
>> Hi list!
>>
>> QgsRubberBand items sometimes not refreshing properly when another map
>> canvas item (QgsVertexMarker) intersects them. This happens with 2.8,
>> in 2.6.1 works as expected.
>>
>> See: https://www.dropbox.com/s/4egl61juue9ewop/rubberband.png?dl=0 as
>> illustration
>>
>> How to reproduce:
>> 1. Open empty project (epsg:4326)
>>
>> 2. Execute this script in python console:
>> from PyQt4.QtCore import *
>> from PyQt4.QtGui import *
>> from qgis.gui import *
>> from qgis.core import *
>>
>> mCursor = QgsVertexMarker(iface.mapCanvas())
>> mCursor.setIconType(QgsVertexMarker.ICON_BOX)
>> mCursor.setIconSize(20)
>> mCursor.setZValue(5)
>>
>> points = [[QgsPoint(0, 0), QgsPoint(20, 30), QgsPoint(0, 60)]]
>>
>> rb = QgsRubberBand(iface.mapCanvas(), True)
>> rb.setToGeometry(QgsGeometry.fromPolygon(points), None)
>> rb.setColor(QColor(125, 125, 0))
>> rb.show()
>>
>> def changeCursorPos(p):
>>     mCursor.setCenter(p)
>>
>> iface.mapCanvas().xyCoordinates.connect(changeCursorPos)
>>
>> 3. Move mouse cursor over rubber band.
>> You can erase rubber band from bottom to some upper point.
>>
>> Tested on win7 32bit
>>
>> Anyone confirms?
>> _______________________________________________
>> Qgis-developer mailing list
>> Qgis-developer at lists.osgeo.org
>> http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Confirmed on Fedora Linux 64bit, current master.


More information about the Qgis-developer mailing list