1

I developed a QGIS Plugin with QGIS Designer but my UI does not look as nice as original QGIS Tools and I was wondering if its possible to make them as good looking.

Specifically, I don't manage to create a nice explanation box like the ones of the original QGIS tools. In the following example, the titel has a higher font and the whole box can be dynamically made smaller or bigger. Any ideas on how this can be done or perhabs a useful link I missed?

enter image description here

  • You can take a look at the .ui which can be found in your QGIS 3 directory, e.g.: C:/Program Files/QGIS 3.8/apps/qgis/python/plugins/processing/ui/DlgAlgorithmBase.ui or from this link – Joseph Oct 10 at 9:56
1

Your screenshot shows the dialog of a processing script. You can create your own scripts by subclassing the QgsProcessingAlgorithm class and re-implementing its methods. The explanation box in your screenshot is achieved simply by re-implementing the shortHelpString() method and returning the text you wish to appear in the explanation box as a string.

There are several good tutorials with templates for writing processing scripts in QGIS 3:

https://docs.qgis.org/testing/en/docs/user_manual/processing/scripts.html

https://www.qgistutorials.com/en/docs/3/processing_python_scripts.html

https://anitagraser.com/2018/03/25/processing-script-template-for-qgis3/

If you want to package a script or collection of scripts into a plugin, you can use Plugin Builder to create a processing plugin which will add a provider in the processing toolbox, containing your custom algorithms.

https://docs.qgis.org/testing/en/docs/pyqgis_developer_cookbook/processing.html

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.