本文整理汇总了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()
示例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()
示例3: onDeleteOldItems
def onDeleteOldItems(self):
from UIManager import UIManager
from db.DBManager import DBManager
scene = UIManager.instance().getScene()
if scene:
scene.clearUnusedItems()
示例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)
示例5: onClearOldestItem
def onClearOldestItem(self):
from UIManager import UIManager
from db.DBManager import DBManager
scene = UIManager.instance().getScene()
if scene:
scene.clearOldItem()
示例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
示例7: mouseDoubleClickEvent
def mouseDoubleClickEvent(self, event):
super(CodeUIEdgeItem, self).mouseDoubleClickEvent(event)
from UIManager import UIManager
scene = UIManager.instance().getScene()
if scene:
scene.showInEditor()
示例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)
示例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
示例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
示例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()
示例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)
示例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()
示例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()
示例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())