Hello all,<div><br></div><div>I've written a qgis plugin for my company, and I'm having some problems debugging it. I'm using an qcompleter to provide autocomplete functionality, and it's....well, not really working out. The plugin is somehow crashing QGIS, but I don't know how; or how to log where things are going wrong. Here's my setup...</div>
<div><br></div><div><div> def autocompleteSetup(self, text):</div><div> if(len(text) == 4):</div><div> buttonName = self.getCheckedButton()</div><div> searcher = self.searchFactory.getSearcher(buttonName)</div>
<div> result = searcher.autocomplete_execute(text)</div><div> resultArray = QStringList()</div><div> self.result = result</div><div> for i in result:</div><div> resultArray.append(i[0])</div>
<div> </div><div> if(len(result) > 0):</div><div> self.autoCompleter = QCompleter(resultArray)</div><div> self.autoCompleter.setCaseSensitivity(0)</div><div> self.autoCompleter.setModelSorting(2)</div>
<div> self.autoCompleter.connect( \</div><div> self.autoCompleter, \</div><div> SIGNAL("activated(QString)"), \</div><div> self.goToLocation)</div><div> self.textBoxQuery.setCompleter(self.autoCompleter)</div>
</div><div><br></div><div>Now I've riddled this thing with file outputs (to try to see what's up) but from everything I can tell, it's not dying within this function; the app crashes shortly after it executes (sporadically -- it doesn't consistently crash.). But none of my code runs after this. So in short; what I really need is a way to debug here. File outputs...really not ideal. Perhaps a way to output to the console? I'm kinda stuck either way, though -- I'm not sure where to go from here. Perhaps most frustratingly, my completer isn't dealing with alpha characters from addresses I'm using. (I'm doing an address search with autocomplete here). So I'll type "123 " and get a list of addresses, but then I type "C" or "c" for the name of the street, and it disappears. </div>
<div><br></div><div>Does anyone else have any ideas as to what's up with this? Any pointers in the right direction would be appreciated.... Thanks!</div>