3

I'd like to get a little more control over the layout and functionality of the user interface associated with a processing script I've created. I've made a ui file using Qt Designer, but I can't figure out how to replace the default form (which uses the ## notation to define parameters) with my new one.

I've found many examples on doing this for a plugin and for feature popups, but nothing for processing scripts.

I tried the following but I just get a blank dialog

from PyQt4 import uic

myForm = uic.loadUi('path_to_ui.ui')
myForm.show()

enter image description here

1

I found that if I made a widget class and put the original code inside it, I can get the form to show as expected. Not sure if this is the best way as I'm still quite new to PyQGIS and coding in general.

from PyQt4 import QtGui, uic

class MyWidget(QtGui.QWidget):
    myForm = uic.loadUi('path_to_ui.ui')
    myForm.show() 
|improve this answer|||||

Your Answer

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

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