Following Python Qgis cookbook, qgis doc and other usefull docs, I succesfully installed and configure the debugger for pluggin as "hello world". But, in the case of specific form, based on python script and Qt .ui files, I cannot figure out how to debug with the Pydev debug server.

I did :

  • run the debug server and the qgis plugin
  • set the python file path on Qgis
  • set the python file path on Pydev project,
  • set a breakpoint on def formOpen(): function
  • open the form under Qgis

The debugger never stop on the breakpoint. enter image description here

1 Answer 1


For debug a QGIS plugins using your configuration and IDE the steps for eclipse projec are:

  • In your other class need import pydev:
    import sys
    from pydevd import *
  • For put a break point you need put the first time settrace() for stop the code in this class

And for example in a Load-QSS Plugin I'm stopping the code when open a main form:

enter image description here

Note that I have put a settrace () before calling this method, this way if you will recognize the next breakpoint

You can show some functional QGIS plugins using this configuration in my Github account

  • thanks for your reply but did you read the question, it's about python Form ? Commented Oct 10, 2017 at 8:47
  • the steps are the same, regardless of whether it's a form, dialog, etc.
    – Fran Raga
    Commented Oct 10, 2017 at 8:49
  • make sure that you put a settrace() before calling your function and that PyDev is imported...
    – Fran Raga
    Commented Oct 10, 2017 at 8:54
  • 1
    whaoou ! you give me the answer. I define a new function called initDebugForm in which I use settrace() method, then call my formOpen function. Under Qgis layer properties define the function name to initDebugForm, and when I open the form, the debugger stop on my breackpoint. thank you so much ! Commented Oct 10, 2017 at 10:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.