def valid(self): msg = '' for cat_name in self.catalog: disp_path_wdgt = self.ui.findChild(QLineEdit, cat_name) if disp_path_wdgt.text(): self.catalog[cat_name] = disp_path_wdgt.text() else: msg += cat_name + '\n' if msg: popup('Catalogues non renseignés :\n\n' + msg) return elif self.check_data(): s = QSettings() s.setValue('catalogs', self.catalog) iface.removeDockWidget(self.ui)
def valid(self): iface.removeDockWidget(self.ui) sqlite = execFileDialog("*.sqlite", "Créer une couche de sortie", "save") wk_lyr = JobManager().create_carhab_lyr(sqlite) for lyr in wk_lyr.getQgisLayers(): if lyr.name().endswith("_polygon"): this_lyr = lyr iface.mapCanvas().setCurrentLayer(lyr) shp_path = self.ui.findChild(QLineEdit, this_lyr.name().split("_")[-1]).text() lyr = ImportLayer().createQgisVectorLayer(shp_path) # thread = QThread() worker = ImportJob(lyr) # worker.moveToThread(thread) # thread.start() # thread.wait() # worker.run() worker.start() print "worker started" worker.wait() print "finished"
# coding: utf-8 from PyQt4.QtCore import Qt from qgis.gui import QgsAdvancedDigitizingDockWidget from qgis.utils import iface canvas = iface.mapCanvas() dock = QgsAdvancedDigitizingDockWidget(canvas) iface.addDockWidget(Qt.RightDockWidgetArea, dock) iface.removeDockWidget(dock) # Access to the existing instance instead of the newly created one print(iface.cadDockWidget()) # Return QGIS existing instance of QgsAdvancedDigitizingDockWidget iface.cadDockWidget().show()
def removeDockWidget(self, dockWidget): if not dockWidget.isVisible(): return iface.removeDockWidget(dockWidget)
def unload(self): """ Wyłączenie modułu """ iface.removeDockWidget(self.dockwidget)
def unload(self): """Unload the plugin.""" QgsApplication.processingRegistry().removeProvider(self.provider) iface.removeDockWidget(self.dock) self.dock.deleteLater()
def remove_explorer(): if dockwidget_instance is not None: iface.removeDockWidget(dockwidget_instance)
def remove_tasking_widget(): if dockwidget_instance is not None: iface.removeDockWidget(dockwidget_instance)
def remove_inspector(): if dockwidget_instance is not None: iface.removeDockWidget(dockwidget_instance)
def close(self): iface.removeDockWidget(self.ui) self.closed.emit()