本文整理汇总了Python中PyQt5.QtWidgets.QDockWidget.__init__方法的典型用法代码示例。如果您正苦于以下问题:Python QDockWidget.__init__方法的具体用法?Python QDockWidget.__init__怎么用?Python QDockWidget.__init__使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWidgets.QDockWidget
的用法示例。
在下文中一共展示了QDockWidget.__init__方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
# 需要导入模块: from PyQt5.QtWidgets import QDockWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QDockWidget import __init__ [as 别名]
def __init__(self, parentObject, windowTitle, windowIcon=QIcon(), shortcut=None):
QDockWidget.__init__(self, parentObject)
self._showAction = None
self.setObjectName(str(self.__class__))
self.setWindowTitle(windowTitle)
self.setFeatures(self.features() & (~QDockWidget.DockWidgetFloatable))
if not windowIcon.isNull():
self.setWindowIcon(windowIcon)
if shortcut is not None:
self.showAction().setShortcut(shortcut)
self._titleBar = _TitleBar(self)
self.setTitleBarWidget(self._titleBar)
if shortcut is not None:
toolTip = "Move focus with <b>%s</b>,<br/>close with <b>Esc</b>" % shortcut
else:
toolTip = "Close with <b>Esc</b>"
self._titleBar.setToolTip(toolTip)
self._closeShortcut = QShortcut(QKeySequence("Esc"), self)
self._closeShortcut.setContext(Qt.WidgetWithChildrenShortcut)
self._closeShortcut.activated.connect(self._close)
示例2: __init__
# 需要导入模块: from PyQt5.QtWidgets import QDockWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QDockWidget import __init__ [as 别名]
def __init__(self, parent, plugin):
self.plugin = plugin
QDockWidget.__init__(self, parent)
self.setupUi(self)
self.btnApply.setIcon(QIcon(":plugins/nominatim/arrow_green.png"))
self.btnMask.setIcon(QIcon(":plugins/nominatim/add_mask.png"))
self.btnLayer.setIcon(QIcon(":plugins/nominatim/add_layer.png"))
self.tableResult.installEventFilter(self) # cf. eventFilter method
self.tableResult.cellDoubleClicked.connect(self.onChoose)
self.tableResult.cellEntered.connect(self.cellEntered)
self.editSearch.returnPressed.connect(self.onReturnPressed)
self.btnSearch.clicked.connect(self.onReturnPressed)
self.btnApply.clicked.connect(self.onApply)
self.btnHelp.clicked.connect(self.plugin.do_help)
self.btnLocalize.clicked.connect(self.doLocalize)
self.btnMask.clicked.connect(self.onMask)
self.btnLayer.clicked.connect(self.onLayer)
self.MultiPolygonLayerId = None
self.LineLayerId = None
self.PointLayerId = None
try:
self.cbExtent.setChecked(self.plugin.limitSearchToExtent)
except:
self.cbExtent.setChecked(self.plugin.limitSearchToExtent)
self.currentExtent = self.plugin.canvas.extent()
self.tableResult.horizontalHeader().setSectionResizeMode(QHeaderView.ResizeToContents)
try:
self.editSearch.setText(self.plugin.lastSearch)
except:
pass
try:
if self.plugin.localiseOnStartup:
self.doLocalize()
except Exception as e:
for m in e.args:
QgsMessageLog.logMessage(m, 'Extensions')
pass
self.nominatim_networkAccessManager = QgsNetworkAccessManager.instance()
示例3: __init__
# 需要导入模块: from PyQt5.QtWidgets import QDockWidget [as 别名]
# 或者: from PyQt5.QtWidgets.QDockWidget import __init__ [as 别名]
def __init__(self,iface):
QDockWidget.__init__(self)
self.iface = iface
GPSLogger.iface = iface
self.canvas = self.iface.mapCanvas()
self.setupUi(self)
self.setupCustomUi()
self.connection = GPSConnection(self.infoList, self.tvInfoList.model(),
QgsCoordinateReferenceSystem(4326, QgsCoordinateReferenceSystem.EpsgCrsId))
self.marker = GPSMarker(self.canvas,
path.join(self.pluginPath, 'markers/krzyz w okregu.svg'),
self)
self.path = GPSPath(self.canvas, self)
self.dataWriter = GPSDataWriter(self)
self.cmbLayers.setFilters( QgsMapLayerProxyModel.HasGeometry )
self.cmbLayers.layerChanged.connect(self.dataWriter.changeLayer)
self.getLeftPoint = GPSGetCanvasPoint(self.canvas, self.btnA)
self.getLeftPoint.pointSide = 'left'
self.getRightPoint = GPSGetCanvasPoint(self.canvas, self.btnB)
self.getRightPoint.pointSide = 'right'
self.resection = GPSResection(self)
self.selectedMarker = GPSSelectedMarker(self.canvas)
self.logger = GPSLogger(self)
self.lastGpsPoint = None
self.measureType = None
self.doIntervalMeasure = False
self.setMenus()
self.setProjectCrs()
self.loadSettings()
self.setupSignals()
self.lastPointElevation = None
self.groups_points = None
self.groupBox_3.setVisible(False)
self.pointListLogger = GPSMeasureSave(self.logger, QSettings().value('gpsTracker/measureSaveInterval', 1, type=int), QSettings().value('gpsTracker/measureSave', True, type=bool))
points = self.pointListLogger.loadMeasure()
if points:
groups = list(set([ p['group_id'] for p in points ]))
self.addEnclaves(len(groups)-1)
self.tvPointList.model().insertRows(points)