當前位置: 首頁>>代碼示例>>Python>>正文


Python QtWidgets.QDockWidget方法代碼示例

本文整理匯總了Python中qgis.PyQt.QtWidgets.QDockWidget方法的典型用法代碼示例。如果您正苦於以下問題:Python QtWidgets.QDockWidget方法的具體用法?Python QtWidgets.QDockWidget怎麽用?Python QtWidgets.QDockWidget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在qgis.PyQt.QtWidgets的用法示例。


在下文中一共展示了QtWidgets.QDockWidget方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: addDockWidget

# 需要導入模塊: from qgis.PyQt import QtWidgets [as 別名]
# 或者: from qgis.PyQt.QtWidgets import QDockWidget [as 別名]
def addDockWidget(self, area, dock_widget: QDockWidget):
        """Add a dock widget to the main window.

        :param area: Where in the ui the dock should be placed.
        :type area:

        :param dock_widget: A dock widget to add to the UI.
        :type dock_widget: QDockWidget
        """
        pass  # pylint: disable=unnecessary-pass 
開發者ID:ghtmtt,項目名稱:DataPlotly,代碼行數:12,代碼來源:qgis_interface.py

示例2: __export_raster_collar

# 需要導入模塊: from qgis.PyQt import QtWidgets [as 別名]
# 或者: from qgis.PyQt.QtWidgets import QDockWidget [as 別名]
def __export_raster_collar(self):
        ret = ExportRasterCollarDialog(self.project).exec_()

    #def __log_strati_clicked(self):
    #    # @todo switch behavior when in section view -> ortho
    #    self.__click_tool = QgsMapToolEmitPoint(self.__iface.mapCanvas())
    #    self.__iface.mapCanvas().setMapTool(self.__click_tool)
    #    self.__click_tool.canvasClicked.connect(self.__map_log_clicked)

    #def __map_log_clicked(self, point, button):
    #    self.__click_tool.setParent(None)
    #    self.__click_tool = None

    #    if self.project is None:
    #        self.__log_strati and self.__log_strati.setParent(None)
    #        self.__log_strati = None
    #        return

    #    if self.__log_strati is None:
    #        self.__log_strati = QDockWidget("Stratigraphic Log")
    #        self.__log_strati.setWidget(BoreHoleWindow(self.project))
    #        self.__iface.addDockWidget(Qt.LeftDockWidgetArea, self.__log_strati)
    #        self.__iface.mainWindow().tabifyDockWidget(
    #            self.__iface.mainWindow().findChild(QDockWidget, "Layers"),
    #            self.__log_strati,
    #        )

    #    res = self.project.closest_hole_id(point.x(), point.y())
    #    if res:
    #        self.__log_strati.widget().scene.set_current_id(res)
    #        self.__log_strati.show()
    #        self.__log_strati.raise_() 
開發者ID:Oslandia,項目名稱:albion,代碼行數:34,代碼來源:plugin.py

示例3: initGui

# 需要導入模塊: from qgis.PyQt import QtWidgets [as 別名]
# 或者: from qgis.PyQt.QtWidgets import QDockWidget [as 別名]
def initGui(self):
        """Create the menu entries and toolbar icons inside the QGIS GUI."""
        icon_path = os.path.join(self.plugin_dir,'res','icon.png')
        self.mainAction = self.add_action(
            icon_path,
            text=self.tr(u'go2mapillary'),
            callback=self.run,
            checkable=True,
            parent=self.iface.mainWindow())

        self.dlg = go2mapillaryDockWidget()

        self.dockwidget=QDockWidget("go2mapillary" , self.iface.mainWindow() )
        self.dockwidget.setObjectName("go2mapillary")
        self.dockwidget.setWidget(self.dlg)
        self.dockwidget.visibilityChanged.connect(self.mlyDockwidgetvisibilityChanged)
        self.dlg.webView.page().setNetworkAccessManager(QgsNetworkAccessManager.instance())
        self.dlg.webView.page().mainFrame().setScrollBarPolicy(Qt.Vertical, Qt.ScrollBarAlwaysOff)
        self.dlg.webView.page().mainFrame().setScrollBarPolicy(Qt.Horizontal, Qt.ScrollBarAlwaysOff)
        self.canvas.mapToolSet.connect(self.toggleViewer)
        self.viewer = mapillaryViewer(self)
        self.viewer.messageArrived.connect(self.viewerConnection)
        self.viewer.openFilter.connect(self.filter_images_func)
        #QgsExpressionContextUtils.setGlobalVariable( "mapillaryCurrentKey","noKey")
        QgsExpressionContextUtils.removeGlobalVariable("mapillaryCurrentKey")
        self.mapSelectionTool = None
        self.coverage = mapillary_coverage(self)
        self.filterDialog = mapillaryFilter(self)
        self.filterAction_images = QAction(QIcon(icon_path), 'filter mapillary coverage', self.iface.mainWindow())
        self.filterAction_sequences = QAction(QIcon(icon_path), 'filter mapillary coverage', self.iface.mainWindow())
        self.filterAction_overview = QAction(QIcon(icon_path), 'filter mapillary coverage', self.iface.mainWindow())
        self.filterAction_images.triggered.connect(self.filter_images_func)
        self.filterAction_sequences.triggered.connect(self.filter_sequences_func)
        self.filterAction_overview.triggered.connect(self.filter_overview_func)
        self.sample_cursor = mapillary_cursor(self)
        self.sample_settings = mapillarySettings(self)
        self.sample_cursor.update_ds(self.sample_settings.settings['sample_source'])
        self.samples_form = mapillaryForm(self)
        self.iface.projectRead.connect(self.removeMapillaryLayerGroup)
        self.canvas.mapCanvasRefreshed.connect(self.mapRefreshed)
        self.enableMapillaryRender = False


    #-------------------------------------------------------------------------- 
開發者ID:enricofer,項目名稱:go2mapillary,代碼行數:46,代碼來源:mapillary_explorer.py

示例4: initGui

# 需要導入模塊: from qgis.PyQt import QtWidgets [as 別名]
# 或者: from qgis.PyQt.QtWidgets import QDockWidget [as 別名]
def initGui(self):
        """Initalise the Plugin-UI"""
        if not pyratImport:
            iface.messageBar().pushMessage("PyRAT not found!",
                                           level=Qgis.Critical)
            return

        if 'PyRAT' not in [action.text() for action in
                           iface.mainWindow().menuBar().actions()]:
            self.pyratMenu = iface.mainWindow().menuBar().addMenu('PyRAT')
        else:
            self.pyratMenu = [action.menu() for action in
                              iface.mainWindow().menuBar().actions() if
                              action.text() == 'PyRAT'][0]

        action = QAction("Layer2PyRAT", iface.mainWindow())
        action.triggered.connect(PyRATBridge.layerToPyrat)
        self.pyratMenu.addAction(action)

        action = QAction("PyRAT2Layer", iface.mainWindow())
        action.triggered.connect(PyRATBridge.pyratToLayer)
        self.pyratMenu.addAction(action)

        action = QAction("Cleanup PyRAT", iface.mainWindow())
        action.triggered.connect(PyRATBridge.clearPyRAT)
        self.pyratMenu.addAction(action)

        action = QAction("Show PyRAT GUI", iface.mainWindow())
        action.triggered.connect(self.showPyrat)
        self.pyratMenu.addAction(action)

        self.pyratMenu.addSeparator()

        # Init PyRAT-Tools, adapted from pyrat.viewer for qgis
        from inspect import getmembers, isclass

        modules = [pyrat.load, pyrat.save, pyrat.transform, pyrat.filter,
                   pyrat.polar, pyrat.insar, pyrat.plugins, pyrat.viewer]

        for current_module in modules:
            modules = getmembers(current_module, isclass)
            for mod in modules:
                if issubclass(mod[1], pyrat.Worker):
                    plugin = mod[1]
                    if(hasattr(plugin, 'gui') and
                       plugin.gui['entry'] != "Python console"):
                        self.addMenuEntry(plugin)

        self.pyratLayerTree = QDockWidget("PyRAT Layers", iface.mainWindow())
        PyRATBridge.layerTreeWidget = LayerTreeWidget(
                parent=self.pyratLayerTree,
                viewer=ViewerToQGISInterface)
        self.pyratLayerTree.setObjectName("PyRAT Layers")
        self.pyratLayerTree.setWidget(PyRATBridge.layerTreeWidget)
        iface.addDockWidget(Qt.LeftDockWidgetArea, self.pyratLayerTree) 
開發者ID:birgander2,項目名稱:PyRAT,代碼行數:57,代碼來源:mainPlugin.py


注:本文中的qgis.PyQt.QtWidgets.QDockWidget方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。