[Qgis-developer] problems debugging my plugin

SJWC GIS sjwcgis at gmail.com
Tue May 22 15:31:09 PDT 2012


Hello all,

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...

    def autocompleteSetup(self, text):
      if(len(text) == 4):
        buttonName = self.getCheckedButton()
        searcher = self.searchFactory.getSearcher(buttonName)
        result = searcher.autocomplete_execute(text)
        resultArray = QStringList()
        self.result = result
        for i in result:
          resultArray.append(i[0])

        if(len(result) > 0):
          self.autoCompleter = QCompleter(resultArray)
          self.autoCompleter.setCaseSensitivity(0)
          self.autoCompleter.setModelSorting(2)
          self.autoCompleter.connect( \
            self.autoCompleter, \
            SIGNAL("activated(QString)"), \
            self.goToLocation)
          self.textBoxQuery.setCompleter(self.autoCompleter)

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.

Does anyone else have any ideas as to what's up with this?  Any pointers in
the right direction would be appreciated....  Thanks!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20120522/516aacaa/attachment-0001.html


More information about the Qgis-developer mailing list