Exemple #1
0
 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)
Exemple #2
0
 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()
Exemple #4
0
 def removeDockWidget(self, dockWidget):
     if not dockWidget.isVisible():
         return
     iface.removeDockWidget(dockWidget)
Exemple #5
0
 def unload(self):
     """ Wyłączenie modułu """
     iface.removeDockWidget(self.dockwidget)
Exemple #6
0
 def unload(self):
     """Unload the plugin."""
     QgsApplication.processingRegistry().removeProvider(self.provider)
     iface.removeDockWidget(self.dock)
     self.dock.deleteLater()
Exemple #7
0
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)
Exemple #9
0
def remove_inspector():
    if dockwidget_instance is not None:
        iface.removeDockWidget(dockwidget_instance)
Exemple #10
0
 def close(self):
     iface.removeDockWidget(self.ui)
     self.closed.emit()