本文整理匯總了Python中qgis.gui.QgsDockWidget.raise_方法的典型用法代碼示例。如果您正苦於以下問題:Python QgsDockWidget.raise_方法的具體用法?Python QgsDockWidget.raise_怎麽用?Python QgsDockWidget.raise_使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類qgis.gui.QgsDockWidget
的用法示例。
在下文中一共展示了QgsDockWidget.raise_方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: ModelerDialog
# 需要導入模塊: from qgis.gui import QgsDockWidget [as 別名]
# 或者: from qgis.gui.QgsDockWidget import raise_ [as 別名]
#.........這裏部分代碼省略.........
self.mActionOpen.setIcon(
QgsApplication.getThemeIcon('/mActionFileOpen.svg'))
self.mActionSave.setIcon(
QgsApplication.getThemeIcon('/mActionFileSave.svg'))
self.mActionSaveAs.setIcon(
QgsApplication.getThemeIcon('/mActionFileSaveAs.svg'))
self.mActionSaveInProject.setIcon(
QgsApplication.getThemeIcon('/mAddToProject.svg'))
self.mActionZoomActual.setIcon(
QgsApplication.getThemeIcon('/mActionZoomActual.svg'))
self.mActionZoomIn.setIcon(
QgsApplication.getThemeIcon('/mActionZoomIn.svg'))
self.mActionZoomOut.setIcon(
QgsApplication.getThemeIcon('/mActionZoomOut.svg'))
self.mActionExportImage.setIcon(
QgsApplication.getThemeIcon('/mActionSaveMapAsImage.svg'))
self.mActionZoomToItems.setIcon(
QgsApplication.getThemeIcon('/mActionZoomFullExtent.svg'))
self.mActionExportPdf.setIcon(
QgsApplication.getThemeIcon('/mActionSaveAsPDF.svg'))
self.mActionExportSvg.setIcon(
QgsApplication.getThemeIcon('/mActionSaveAsSVG.svg'))
self.toolbutton_export_to_script.setIcon(
QgsApplication.getThemeIcon('/mActionSaveAsPython.svg'))
self.mActionEditHelp.setIcon(
QgsApplication.getThemeIcon('/mActionEditHelpContent.svg'))
self.mActionRun.setIcon(
QgsApplication.getThemeIcon('/mActionStart.svg'))
self.addDockWidget(Qt.LeftDockWidgetArea, self.propertiesDock)
self.addDockWidget(Qt.LeftDockWidgetArea, self.inputsDock)
self.addDockWidget(Qt.LeftDockWidgetArea, self.algorithmsDock)
self.tabifyDockWidget(self.inputsDock, self.algorithmsDock)
self.inputsDock.raise_()
self.setWindowFlags(Qt.WindowMinimizeButtonHint |
Qt.WindowMaximizeButtonHint |
Qt.WindowCloseButtonHint)
settings = QgsSettings()
self.restoreState(settings.value("/Processing/stateModeler", QByteArray()))
self.restoreGeometry(settings.value("/Processing/geometryModeler", QByteArray()))
self.scene = ModelerScene(self, dialog=self)
self.scene.setSceneRect(QRectF(0, 0, self.CANVAS_SIZE, self.CANVAS_SIZE))
self.view.setScene(self.scene)
self.view.setAcceptDrops(True)
self.view.ensureVisible(0, 0, 10, 10)
self.view.scale(QgsApplication.desktop().logicalDpiX() / 96, QgsApplication.desktop().logicalDpiX() / 96)
def _dragEnterEvent(event):
if event.mimeData().hasText() or event.mimeData().hasFormat('application/x-vnd.qgis.qgis.algorithmid'):
event.acceptProposedAction()
else:
event.ignore()
def _dropEvent(event):
def alg_dropped(algorithm_id, pos):
alg = QgsApplication.processingRegistry().createAlgorithmById(algorithm_id)
if alg is not None:
self._addAlgorithm(alg, pos)
else:
assert False, algorithm_id
def input_dropped(id, pos):
示例2: ModelerDialog
# 需要導入模塊: from qgis.gui import QgsDockWidget [as 別名]
# 或者: from qgis.gui.QgsDockWidget import raise_ [as 別名]
#.........這裏部分代碼省略.........
self.mToolbar.setIconSize(iface.iconSize())
self.mActionOpen.setIcon(
QgsApplication.getThemeIcon('/mActionFileOpen.svg'))
self.mActionSave.setIcon(
QgsApplication.getThemeIcon('/mActionFileSave.svg'))
self.mActionSaveAs.setIcon(
QgsApplication.getThemeIcon('/mActionFileSaveAs.svg'))
self.mActionZoomActual.setIcon(
QgsApplication.getThemeIcon('/mActionZoomActual.svg'))
self.mActionZoomIn.setIcon(
QgsApplication.getThemeIcon('/mActionZoomIn.svg'))
self.mActionZoomOut.setIcon(
QgsApplication.getThemeIcon('/mActionZoomOut.svg'))
self.mActionExportImage.setIcon(
QgsApplication.getThemeIcon('/mActionSaveMapAsImage.svg'))
self.mActionZoomToItems.setIcon(
QgsApplication.getThemeIcon('/mActionZoomFullExtent.svg'))
self.mActionExportPdf.setIcon(
QgsApplication.getThemeIcon('/mActionSaveAsPDF.svg'))
self.mActionExportSvg.setIcon(
QgsApplication.getThemeIcon('/mActionSaveAsSVG.svg'))
#self.mActionExportPython.setIcon(
# QgsApplication.getThemeIcon('/mActionSaveAsPython.svg'))
self.mActionEditHelp.setIcon(
QgsApplication.getThemeIcon('/mActionEditHelpContent.svg'))
self.mActionRun.setIcon(
QgsApplication.getThemeIcon('/mActionStart.svg'))
self.addDockWidget(Qt.LeftDockWidgetArea, self.propertiesDock)
self.addDockWidget(Qt.LeftDockWidgetArea, self.inputsDock)
self.addDockWidget(Qt.LeftDockWidgetArea, self.algorithmsDock)
self.tabifyDockWidget(self.inputsDock, self.algorithmsDock)
self.inputsDock.raise_()
self.zoom = 1
self.setWindowFlags(Qt.WindowMinimizeButtonHint |
Qt.WindowMaximizeButtonHint |
Qt.WindowCloseButtonHint)
settings = QgsSettings()
self.restoreState(settings.value("/Processing/stateModeler", QByteArray()))
self.restoreGeometry(settings.value("/Processing/geometryModeler", QByteArray()))
self.scene = ModelerScene(self, dialog=self)
self.scene.setSceneRect(QRectF(0, 0, self.CANVAS_SIZE, self.CANVAS_SIZE))
self.view.setScene(self.scene)
self.view.setAcceptDrops(True)
self.view.ensureVisible(0, 0, 10, 10)
def _dragEnterEvent(event):
if event.mimeData().hasText():
event.acceptProposedAction()
else:
event.ignore()
def _dropEvent(event):
if event.mimeData().hasText():
itemId = event.mimeData().text()
if itemId in [param.id() for param in QgsApplication.instance().processingRegistry().parameterTypes()]:
self.addInputOfType(itemId, event.pos())
else:
alg = QgsApplication.processingRegistry().createAlgorithmById(itemId)
if alg is not None: