I need to create a dock plugin for QGIS using QT designer and Python. I've created a basic plugin in "plugin builder". Then I've changed the .ui so now I dont have standard QDialog box but a QDockWidget. So now i have "plugin_module_dialog.py" that looks like that:
import os
from PyQt4 import QtGui, uic
FORM_CLASS, _ = uic.loadUiType(os.path.join(
os.path.dirname(__file__), 'testing_module_dialog_base.ui'))
class testing_classDialog(QtGui.QDockWidget, FORM_CLASS):
def __init__(self, parent=None):
"""Constructor."""
super(testing_classDialog, self).__init__(parent)
self.setupUi(self)
and "plugin_module.py" like that:
class testing_class:
def __init__(self, iface):
self.iface = iface
path = os.path.dirname( os.path.abspath( __file__ ) )
self.dock = uic.loadUi( os.path.join( path, "plugin_module_dialog_base.ui" ) )
self.iface.addDockWidget( Qt.RightDockWidgetArea, self.dock )
...
Now when i run that plugin i get:
AttributeError: 'plugin_classDialog' object has no attribute 'exec_'
And the plugin window pops up normally. Not docked. I am new to that. Please explain me what should I do to get working dock plugin.