1

I've created a .ui using QT Designer for a QGIS 3.10 plugin called 'bhlayers' which has a docking widget to the right. When I used the: pb_tool deploy command it didn't seem to translate the .ui to the bhlayers.py file as I expected. It hasn't set up the Qt buttons, checkboxes, horizontal layouts, labels, lineEdits etc.

Is it not supposed to? If it isn't how do you relate the .ui objects with the python code that detects interactions with the interface. Example:

if dbBox.isChecked() == True:  ..

So I then tried instead to use pyuic5:

pyuic5.bat -x bhlayers_dockwidget_base.ui -o bhlayers.py

This time the bhlayers.py has all the Qt objects created, buttons, checkboxes, etc.

However it looks like pyuic5 is compiled in a completely different format to pb_tool and is not compatible (at least without a lot of editing) with how QGIS plugins work.

I've created QT applications before but manually without the QT Designer. I wonder whether I should have stuck to that - as I am a bit lost now.

Does anyone know what I'm doing wrong? Or what wrong assumptions I'm making?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.