I'm playing with QDockWidgets. Here is the piece of code i'm trying :
def dock(self): widget = uic.loadUi("C:\dock.ui") self.iface.addDockWidget(Qt.RightDockWidgetArea, widget) widget.setFloating(True) widget.setWindowTitle("Dock ...") #QMessageBox.information(None,"Testing dockWidgets ...","Working or not ... ?")
When the QmessageBox line is left commented nothing works (the widget doesn't appear on the screen nor in the panel list of QGIS)
When the Qmessagebox line is uncommented the widget appears, title is set but widget disappear once the QMessageBox is closed ...
I fear i might be something linked with the indentation of my code but i feel i tried everything ...
Am I forgetting something ?
What should i do to have the widget remain after this piece of code is executed ?
Or could it be linked with the dynamic loading of the widget's ui ?