Re: [QGIS-Developer] QgsRubberband

2018-09-24 Thread Adam Borczyk
Hi, thanks for your answer. Seems memory layer is the only way to go. Best regards On Sun, 23 Sep 2018 at 22:38, Tim Sutton wrote: > Hi Adam > > I think the idiomatic way to do this would be to rather make (convert > rubber bands to) a memory layer with some features that you need displayed >

Re: [QGIS-Developer] QgsRubberband

2018-09-23 Thread Tim Sutton
Hi Adam I think the idiomatic way to do this would be to rather make (convert rubber bands to) a memory layer with some features that you need displayed for printing and then remove it again after the print is done (aka a redlining layer). Regards Tim > On 23 Sep 2018, at 15:45, Adam

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-13 Thread Denis Rouzaud
Hi Radim, It seems it is your point that has been deleted, not the rubber band. Doing print point before addPoint crashes. Cheers, Denis On 13. 02. 14 08:39, Radim Blazek wrote: On Thu, Feb 13, 2014 at 8:35 AM, Radim Blazek radim.bla...@gmail.com wrote: On Thu, Feb 13, 2014 at 7:13 AM,

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-13 Thread Radim Blazek
On Thu, Feb 13, 2014 at 9:04 AM, Denis Rouzaud denis.rouz...@gmail.com wrote: Hi Radim, It seems it is your point that has been deleted, not the rubber band. Doing print point before addPoint crashes. Good, thanks and sorry for false pointing to rubber band. However, do you have any idea

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-13 Thread Denis Rouzaud
On 13. 02. 14 09:45, Radim Blazek wrote: On Thu, Feb 13, 2014 at 9:04 AM, Denis Rouzaud denis.rouz...@gmail.com wrote: Hi Radim, It seems it is your point that has been deleted, not the rubber band. Doing print point before addPoint crashes. Good, thanks and sorry for false pointing to rubber

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-13 Thread Radim Blazek
Thanks Denis, However, do you have any idea where the point may be deleted? The points are acquired from QgsGeometry.asPolyline() which returns QVectorQgsPoint, i.e. list of values. The points are then add to another list: result.extend( pnts[1:-1] ). Is it wrong? The points get deleted with

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-13 Thread Denis Rouzaud
On 13. 02. 14 12:45, Radim Blazek wrote: Thanks Denis, However, do you have any idea where the point may be deleted? The points are acquired from QgsGeometry.asPolyline() which returns QVectorQgsPoint, i.e. list of values. The points are then add to another list: result.extend( pnts[1:-1] ).

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-13 Thread Martin Dobias
On Thu, Feb 13, 2014 at 7:56 PM, Denis Rouzaud denis.rouz...@gmail.com wrote: 2) If a SIP wrapper class A has a member class B and an instance of A is created in Python, B member is referenced and reference to A is deleted is it the A instance deleted by GC including B (which is still

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-13 Thread Martin Dobias
Hi Vincent On Fri, Feb 14, 2014 at 2:17 AM, Vincent Mora vincent.m...@oslandia.com wrote: I found that a bit surprising, so I did the test, an actually python+sip do a pretty good job in ref counting (at least for the mentioned classes which are pretty simple) I Added a dtor to

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-12 Thread Radim Blazek
On Wed, Feb 12, 2014 at 1:45 PM, Radim Blazek radim.bla...@gmail.com wrote: I am using rubber band in Python plugin: self.rb = QgsRubberBand(self.canvas, QGis.Polygon) and on mouse move self.rb.addPoint( point, update ) It works well on most systems only for Win7/32bit (QGIS 2.0.1,

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-12 Thread Radim Blazek
On Wed, Feb 12, 2014 at 2:50 PM, Martin Dobias wonder...@gmail.com wrote: Hi Radim On Wed, Feb 12, 2014 at 8:03 PM, Radim Blazek radim.bla...@gmail.com wrote: On Wed, Feb 12, 2014 at 1:45 PM, Radim Blazek radim.bla...@gmail.com wrote: I am using rubber band in Python plugin: self.rb =

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-12 Thread Denis Rouzaud
Hi Radim, Can you show us the whole code? Cheers, Denis On 12. 02. 14 19:17, Radim Blazek wrote: On Wed, Feb 12, 2014 at 2:50 PM, Martin Dobias wonder...@gmail.com wrote: Hi Radim On Wed, Feb 12, 2014 at 8:03 PM, Radim Blazek radim.bla...@gmail.com wrote: On Wed, Feb 12, 2014 at 1:45 PM,

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-12 Thread Radim Blazek
On Thu, Feb 13, 2014 at 7:13 AM, Denis Rouzaud denis.rouz...@gmail.com wrote: Hi Radim, Can you show us the whole code? https://github.com/blazek/spline/blob/master/spline/spline.py Radim Cheers, Denis On 12. 02. 14 19:17, Radim Blazek wrote: On Wed, Feb 12, 2014 at 2:50 PM, Martin

Re: [Qgis-developer] QgsRubberBand RuntimeError: underlying C/C++ object has been deleted

2014-02-12 Thread Radim Blazek
On Thu, Feb 13, 2014 at 8:35 AM, Radim Blazek radim.bla...@gmail.com wrote: On Thu, Feb 13, 2014 at 7:13 AM, Denis Rouzaud denis.rouz...@gmail.com wrote: Hi Radim, Can you show us the whole code? https://github.com/blazek/spline/blob/master/spline/spline.py And traceback: Traceback (most

Re: [Qgis-developer] QgsRubberband does not draw polygons(python)

2013-04-08 Thread vinayan
thanks to Salvatore's help on irc, i got over this issue. apparently the 'isPolygon' method was deprected.. here is the snippet that worked.. mCanvas = iface.mapCanvas() rb = QgsRubberBand(mCanvas,QGis.Polygon) rb.addPoint(QgsPoint(300,300)) rb.addPoint(QgsPoint(400,400))

Re: [Qgis-developer] QgsRubberBand 1px shift

2011-05-11 Thread Radim Blazek
On Mon, May 2, 2011 at 4:31 PM, Martin Dobias wonder...@gmail.com wrote: Oh, I see! This really looks like a bug in x11 paint engine (running Qt 4.6.2 here). If you use QImage (raster engine) instead of QPixmap you get the expected result (line still on the first row). Also OpenGL engine gives

Re: [Qgis-developer] QgsRubberBand 1px shift

2011-05-02 Thread Radim Blazek
On Mon, May 2, 2011 at 3:04 PM, Martin Dobias wonder...@gmail.com wrote: // use the same rounding as in qrasterizer.cpp (6 bit fixed point) static const qreal aliasedCoordinateDelta = 0.5 - 0.015625; As far as I understand this, Qt treats pixels to be squares (x,y) to (x+1,y+1), where x and y