<div class="gmail_extra"><div class="gmail_quote"><div class="gmail_extra">Nevermind; I found my issue. I had an infinite recursion that was calling the search function and recreating the QCompleter each loop. That's why it was crashing the application. Again, thanks for the Console tip -- that was invaluable. </div>
<div class="gmail_extra"><br></div><div class="gmail_extra">Aaron<div><div class="h5"><br><br><div class="gmail_quote">On Wed, Apr 25, 2012 at 9:28 AM, SJWC GIS <span dir="ltr"><<a href="mailto:sjwcgis@gmail.com" target="_blank">sjwcgis@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra">Hi Bernhard,</div><div class="gmail_extra"><br></div><div class="gmail_extra">I tried again this morning (using the Python Console, which I didn't actually realize existed before your email) and sure enough, it worked. I'm still having the problem, but I think I've been able to narrow it down a little better. The method actually works when I'm using a push button to trigger it. However, I'm also using a QCompleter to provide autocomplete functionality with a list of addresses. When the QCompleter is activated (a value is selected) the program crashes. This seems odd to me, since I can tell from the output that the whole method executes -- it crashes some time after I refresh the map canvas. I don't think the map canvas refresh in itself crashes it (logging seems to indicate that that method finishes) but rather something related to my QCompleter's activate signal. Any ideas on why this might be the case? </div>
<div class="gmail_extra"><br></div><div class="gmail_extra">In any case, thanks for your help...it got me a bit further down the stream.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Aaron<div><div>
<br><br><div class="gmail_quote">
On Tue, Apr 24, 2012 at 11:43 PM, <span dir="ltr"><<a href="mailto:bernhard.stroebl@jena.de" target="_blank">bernhard.stroebl@jena.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi Aaron,<br>
<br>
the code works for me when entering it in the console directly (QGIS 1.7.1/WinXP)<br>
Maybe there is something wrong with your coordinates? Try to enter values for x and y directly in the code and see if it works.<br>
<br>
Bernhard<br>
<br>
Am <a href="tel:25.04.2012%2007" value="+12504201207" target="_blank">25.04.2012 07</a>:00, schrieb Denis Rouzaud:<div><div><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi,<br>
<br>
How is defined self.plugin ?<br>
<br>
On 04/25/2012 01:30 AM, SJWC GIS wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello all,<br>
<br>
I've written a piece of code that will search a database for a given<br>
point, and then return that point so we can center the map canvas on<br>
it and zoom in. Unfortunately, it's not working. QGIS crashes after<br>
the code executes, leaving no error messages behind. Is there a better<br>
way to center/zoom to a given point? I've tried the canvas method<br>
"centerWithZoom" as well, with no success. (It also crashes.) I have<br>
checked my coords -- they are in the proper projection (the same as<br>
the mapCanvas) and I haven't reversed them. Any other ideas/methods of<br>
accomplishing this are greatly appreciated. Thanks!<br>
<br>
Aaron<br>
<br>
x = result[0][1]<br>
y = result[0][2]<br>
xscale = 1.0<br>
<br>
# Get the map canvas<br>
mc = self.plugin.iface.mapCanvas()<br>
<br>
height2 = mc.extent().height() * xscale / 2.0<br>
width2 = mc.extent().width() * xscale / 2.0<br>
<br>
rect = QgsRectangle(x-width2,y-<u></u>height2,x+width2,y+height2)<br>
<br>
# Set the extent to our new rectangle<br>
mc.setExtent(rect)<br>
<br>
# Refresh the map<br>
mc.refresh()<br>
<br>
<br>
</blockquote></blockquote>
<br>
<br></div></div>
________ Information from NOD32 ________<br>
This message was checked by NOD32 Antivirus System for Linux Mail Server.<br>
<a href="http://www.nod32.com" target="_blank">http://www.nod32.com</a><br>
</blockquote></div><br></div></div></div>
</blockquote></div><br></div></div></div>
</div><br></div>