本文整理匯總了Python中panel.Panel.setVisible方法的典型用法代碼示例。如果您正苦於以下問題:Python Panel.setVisible方法的具體用法?Python Panel.setVisible怎麽用?Python Panel.setVisible使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類panel.Panel
的用法示例。
在下文中一共展示了Panel.setVisible方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。
示例1: __init__
# 需要導入模塊: from panel import Panel [as 別名]
# 或者: from panel.Panel import setVisible [as 別名]
class ProcessingManager:
""" Processing plugin
"""
def __init__(self, iface):
self._iface = iface
self.panel = None
self.settings = None
self.aboutDialog = None
self.workflowBuilder = None
def initGui(self):
from PyQt4.QtCore import QObject, SIGNAL
from PyQt4.QtGui import QMenu
self.menu = QMenu()
self.menu.setTitle(self.menu.tr("&Processing", "Processing"))
# We only generate the panel & populate the menu when needed,
# to increase our chances that the framework has been loaded.
QObject.connect(self.menu, SIGNAL("aboutToShow()"),
self.populateMenu)
menuBar = self._iface.mainWindow().menuBar()
menuBar.insertMenu(menuBar.actions()[-1], self.menu)
def populateMenu(self):
from panel import Panel
from PyQt4.QtCore import QObject, SIGNAL
from PyQt4.QtGui import QAction
if not self.panel:
self.panel = Panel(self._iface)
self.panel.setVisible(False)
self.panelAction = self.panel.toggleViewAction()
self.menu.addAction(self.panelAction)
self.settingsAction = QAction(
self.menu.tr("&Settings", "Processing"),
self._iface.mainWindow())
self.menu.addAction(self.settingsAction)
QObject.connect(self.settingsAction,
SIGNAL("triggered()"), self.showSettings)
self.workflowBuilderAction= QAction(
self.menu.tr("&Workflow builder", "Processing"),
self._iface.mainWindow())
self.menu.addAction(self.workflowBuilderAction)
QObject.connect(self.workflowBuilderAction,
SIGNAL("triggered()"), self.showWorkflowBuilder)
self.aboutAction = QAction(
self.menu.tr("&About", "Processing"),
self._iface.mainWindow())
self.menu.addAction(self.aboutAction)
QObject.connect(self.aboutAction,
SIGNAL("triggered()"), self.showAboutDialog)
def unload(self):
if self.panel:
self.panel.setVisible(False)
def showSettings(self):
from settings import Settings
if not self.settings:
self.settings = Settings(self._iface.mainWindow())
self.settings.setVisible(True)
def showAboutDialog(self):
from aboutdialog import AboutDialog
if not self.aboutDialog:
self.aboutDialog = AboutDialog(self._iface.mainWindow())
self.aboutDialog.setVisible(True)
def showWorkflowBuilder(self):
from workflowBuilder import WorkflowBuilder
if not self.workflowBuilder:
self.workflowBuilder = WorkflowBuilder(self._iface)
self.workflowBuilder.setVisible(True)