[QGIS-Developer] QGIS3 plugin migration issue

André William wss.andre at gmail.com
Fri Mar 30 14:54:08 PDT 2018


Hi all,

I'm porting an existing Geoprocessing Algorithm plugin to QGIS 3 and I'm
having some trouble customizing the default dialog.
On QGIS 2.x the following code worked:

class TestAlgorithm(GeoAlgorithm):
>     INPUT = 'INPUT'
>     OUTPUT = 'OUTPUT'
>

>
    def getCustomParametersDialog(self):
>         customDialog = AlgorithmDialog(self)
>         customDialog.textShortHelp.setFixedWidth(450)
>         return customDialog
>

On QGIS 3 however, the getCustomParametersDialog() method is gone. I
assumed it was replaced by the new createCustomParametersWidget(), but
unfortunately this method doesn't seem to get called by the parent class:

    def createCustomParametersWidget(self, parent):
>         customDialog = AlgorithmDialog(self)
>         customDialog.textShortHelp.setFixedWidth(450)
>         return customDialog
>

I also tried manually creating the dialog, but I get a message saying that
the *'AlgorithmDialog' object has no attribute 'textShortHelp'.*

alg =
> QgsApplication.processingRegistry().algorithmById('test:testAlgorithm')
> dlg = AlgorithmDialog(alg)
> dlg.textShortHelp.setFixedWidth(450)
> dlg.show()
>

Any thoughts?

Thanks in advance!
André
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20180330/25663ca6/attachment.html>


More information about the QGIS-Developer mailing list