[Qgis-developer] Is there an advantage in using pyuic on command line instead of uic.loadUi in plugin source?
lists at linfiniti.com
Mon May 5 23:52:29 PDT 2014
On Sat, Apr 26, 2014 at 2:45 PM, Anita Graser <anitagraser at gmx.at> wrote:
> I'm wondering if there is an advantage in using pyuic to manually compile
> .ui files instead of just using uic.loadUi() in the plugin directly, e.g.
> from PyQt4 import uic
> self.dock = uic.loadUi( os.path.join( path, "dockwidget2.ui" ) )
As Martin mentioned, getting the class type back is nicer. I tested this
and it works nicely:
from PyQt4 import QtCore, QtGui, uic
BASE_CLASS = uic.loadUiType(os.path.join(
class ResultDialog(QtGui.QDialog, BASE_CLASS):
"""Dialog for showing the results of the plugin creation process."""
# Set up the user interface from Designer.
The advantage is that you can use Qt multi-inheritance which means less and
cleaner code. More details in the Qt section at .
> Thanks for any insights!
> Best wishes,
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
Tim Sutton - QGIS Project Steering Committee Member
Please do not email me off-list with technical
support questions. Using the lists will gain
more exposure for your issues and the knowledge
surrounding your issue will be shared with all.
Irc: timlinux on #qgis at freenode.net
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Qgis-developer