当前位置: 首页>>代码示例>>Python>>正文


Python UIManager.UIManager类代码示例

本文整理汇总了Python中UIManager.UIManager的典型用法代码示例。如果您正苦于以下问题:Python UIManager类的具体用法?Python UIManager怎么用?Python UIManager使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了UIManager类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: onDeleteSelectedItemsAndAddToStop

	def onDeleteSelectedItemsAndAddToStop(self):
		from UIManager import UIManager
		scene = UIManager.instance().getScene()
		if scene:
			scene.deleteSelectedItems(True)
			mainUI = UIManager.instance().getMainUI()
			mainUI.symbolDock.widget().updateForbiddenSymbol()
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:7,代码来源:mainwindow.py

示例2: _onOpen

	def _onOpen(self):
		from UIManager import UIManager
		scene = UIManager.instance().getScene()
		scene.onOpenDB()

		mainUI = UIManager.instance().getMainUI()
		mainUI.symbolDock.widget().updateForbiddenSymbol()
		mainUI.schemeDock.widget().updateScheme()
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:8,代码来源:DBManager.py

示例3: onDeleteOldItems

	def onDeleteOldItems(self):
		from UIManager import UIManager
		from db.DBManager import DBManager

		scene = UIManager.instance().getScene()
		if scene:
			scene.clearUnusedItems()
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:7,代码来源:mainwindow.py

示例4: __init__

	def __init__(self, *args):
		super(CodeView, self).__init__(*args)
		from UIManager import UIManager
		self.setScene(UIManager.instance().getScene())
		self.setViewportUpdateMode(QtWidgets.QGraphicsView.FullViewportUpdate)
		self.setCacheMode(QtWidgets.QGraphicsView.CacheNone)
		#self.setDragMode(QtWidgets.QGraphicsView.RubberBandDrag)
		self.setTransformationAnchor(QtWidgets.QGraphicsView.AnchorUnderMouse)
		self.setMouseTracking(True)
		self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
		self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAsNeeded)
		self.setHorizontalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
		self.setVerticalScrollBarPolicy(QtCore.Qt.ScrollBarAlwaysOff)
		self.setAcceptDrops(True)

		self.mousePressPnt = None
		self.mouseCurPnt = None
		self.isFrameSelectMode = False
		self.isMousePressed = False
 
		self.updateTimer = QtCore.QTimer()
		self.updateTimer.setInterval(70)
		# self.connect(self.updateTimer, QtCore.SIGNAL('timeout()'), self, QtCore.SLOT('updateView()'))
		self.updateTimer.timeout.connect(self.updateView)
		self.centerPnt = QtCore.QPointF()
		self.scale(0.6,0.6)
		self.brushRadius = 8
		self.setBackgroundBrush(QtGui.QBrush(QtGui.QColor(50,50,50)))
		self.hudFont = QtGui.QFont('tahoma', 8)
		self.hudFontMetric = QtGui.QFontMetrics(self.hudFont)
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:30,代码来源:codeview.py

示例5: onClearOldestItem

	def onClearOldestItem(self):
		from UIManager import UIManager
		from db.DBManager import DBManager

		scene = UIManager.instance().getScene()
		if scene:
			scene.clearOldItem()
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:7,代码来源:mainwindow.py

示例6: drawScheme

	def drawScheme(self, painter, rectF):
		from UIManager import UIManager
		scene = UIManager.instance().getScene()
		schemeList = scene.getCurrentSchemeList()
		nScheme = len(schemeList)
		if not nScheme:
			return
		painter.setTransform(QtGui.QTransform())
		painter.setFont(self.hudFont)
		colorList = scene.getCurrentSchemeColorList()
		cw = 10
		y  = 10

		maxWidth = 0
		for ithScheme, schemeName in enumerate(schemeList):
			schemeSize = self.hudFontMetric.size(QtCore.Qt.TextSingleLine, schemeName)
			maxWidth = max(maxWidth, schemeSize.width())

		painter.setCompositionMode(QtGui.QPainter.CompositionMode_Multiply)
		painter.setPen(QtCore.Qt.NoPen)
		painter.setBrush(QtGui.QColor(0,0,0,150))
		painter.drawRect(5,5, 80 + maxWidth, nScheme * cw + (nScheme-1)*2 + 10)

		painter.setCompositionMode(QtGui.QPainter.CompositionMode_Source)
		for ithScheme, schemeName in enumerate(schemeList):
			painter.setPen(QtCore.Qt.NoPen)
			painter.setBrush(QtGui.QBrush(colorList[ithScheme]))
			painter.drawRect(QtCore.QRect(10,y+5,20,2))

			painter.setPen(QtGui.QPen(QtGui.QColor(255,157,38,255),1))
			painter.drawText(39, y+cw, 'Alt + %s' % (ithScheme+1,))
			painter.setPen(QtGui.QPen(QtGui.QColor(255,255,255,255),1))
			painter.drawText(QtCore.QRect(80,y-1,maxWidth,cw+3), QtCore.Qt.AlignRight | QtCore.Qt.AlignTop, schemeName)
			y += cw + 2
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:34,代码来源:codeview.py

示例7: mouseDoubleClickEvent

	def mouseDoubleClickEvent(self, event):
		super(CodeUIEdgeItem, self).mouseDoubleClickEvent(event)

		from UIManager import UIManager
		scene = UIManager.instance().getScene()
		if scene:
			scene.showInEditor()
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:7,代码来源:CodeUIEdgeItem.py

示例8: onSelectItems

	def onSelectItems(self):
		from ui.CodeUIItem import CodeUIItem
		from ui.CodeUIEdgeItem import CodeUIEdgeItem
		itemList = self.selectedItems()
		# update LRU
		self.selectTimeStamp += 1
		for item in itemList:
			if not isinstance(item, CodeUIItem):
				continue
			item.selectCounter += 1
			item.selectTimeStamp = self.selectTimeStamp
			uniqueName = item.getUniqueName()
			self.updateLRU([uniqueName])

		self.removeItemLRU()

		# update comment
		itemName = ''
		itemComment = ''
		if len(itemList) == 1:
			item = itemList[0]
			if isinstance(item, CodeUIItem):
				itemName = item.name
				itemComment = self.itemDataDict.get(item.uniqueName, {}).get('comment','')
			elif isinstance(item, CodeUIEdgeItem):
				srcItem = self.itemDict.get(item.srcUniqueName)
				tarItem = self.itemDict.get(item.tarUniqueName)
				if srcItem and tarItem:
					itemName = srcItem.name + ' -> ' + tarItem.name
					itemComment = self.edgeDataDict.get((item.srcUniqueName, item.tarUniqueName), {}).get('comment', '')

		from UIManager import UIManager
		symbolWidget = UIManager.instance().getMainUI().getSymbolWidget()
		if symbolWidget:
			symbolWidget.updateSymbol(itemName, itemComment)
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:35,代码来源:codescene.py

示例9: drawComment

	def drawComment(self, painter, rectF):
		from UIManager import UIManager
		scene = UIManager.instance().getScene()

		for uname, itemData in scene.itemDataDict.items():
			item = scene.itemDict.get(uname, None)
			if not item:
				continue
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:8,代码来源:codeview.py

示例10: getMiddlePos

	def getMiddlePos(self):
		from UIManager import UIManager
		scene = UIManager.instance().getScene()
		srcNode = scene.getNode(self.srcUniqueName)
		tarNode = scene.getNode(self.tarUniqueName)
		if not srcNode or not tarNode:
			return QtCore.QPointF()
		return (srcNode.pos() + tarNode.pos()) * 0.5
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:8,代码来源:CodeUIEdgeItem.py

示例11: onAddToScene

	def onAddToScene(self):
		item = self.resultList.currentItem()

		from UIManager import UIManager
		scene = UIManager.instance().getScene()

		if not item or not scene:
			return

		scene.acquireLock()
		res, codeItem = scene.addCodeItem(item.getUniqueName())

		if codeItem:
			UIManager.instance().getScene().clearSelection()
			codeItem.setSelected(True)

		scene.releaseLock()
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:17,代码来源:searchwindow.py

示例12: showScheme

	def showScheme(self, param):
		ithScheme = param[0]-1
		isSelected = False
		if len(param) >= 2:
			isSelected = param[1]
		from UIManager import UIManager
		scene = UIManager.instance().getScene()
		if scene:
			scene.showIthScheme(ithScheme, isSelected)
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:9,代码来源:mainwindow.py

示例13: onAnalyze

	def onAnalyze(self):
		dbmgr = DBManager.DBManager.instance()
		from UIManager import UIManager
		scene = UIManager.instance().getScene()
		if scene:
			scene.acquireLock()
			dbmgr.analysisDB()
			#dbmgr.getDB().open(r'C:\Users\me\AppData\Roaming\Sublime Text 3\Packages\CodeAtlas\CodeAtlasSublime.udb')
			scene.releaseLock()
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:9,代码来源:mainwindow.py

示例14: onDeleteScheme

	def onDeleteScheme(self):
		item = self.schemeList.currentItem()
		if not item:
			QtWidgets.QMessageBox.warning(self, "Warning", "Please select an item to delete.")
			return

		from UIManager import UIManager
		scene = UIManager.instance().getScene()
		scene.deleteScheme(item.getUniqueName())
		self.updateScheme()
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:10,代码来源:schemewindow.py

示例15: getNodePos

	def getNodePos(self):
		from UIManager import UIManager
		scene = UIManager.instance().getScene()
		srcNode = scene.getNode(self.srcUniqueName)
		tarNode = scene.getNode(self.tarUniqueName)
		if not srcNode or not tarNode:
			return QtCore.QPointF(), QtCore.QPointF()
		srcPos = srcNode.pos()
		tarPos = tarNode.pos()
		return (srcNode.getRightSlotPos(), tarNode.getLeftSlotPos())
开发者ID:league1991,项目名称:CodeAtlasSublime,代码行数:10,代码来源:CodeUIEdgeItem.py


注:本文中的UIManager.UIManager类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。