Beispiel #1
0
def getIcon(name, fallback=None):
	global _iconCache
	if not name: return _nullIcon

	icon = _iconCache.get(name,None)
	if icon: return icon
	iconFile = None
	path = app.findDataFile( 'icons/%s.png' % name )
	if not path:
		if fallback:
			return getIcon(fallback)
		logging.error('icon not found: %s' % name)
		return QtGui.QIcon()

	icon = QtGui.QIcon(QtGui.QPixmap(path))
	_iconCache[name]=icon
	return icon
Beispiel #2
0
def getCursor(name, fallback=None):
	global _cursorCache
	if not name: return QtGui.QCursor()

	cursor = _cursorCache.get(name,None)
	if cursor: return cursor
	iconFile = None
	path = app.findDataFile( 'cursor/%s.png' % name )
	if not path:
		if fallback:
			return getCursor(fallback)
		logging.error('cursor not found: %s' % name)
		return QtGui.QCursor()

	cursor = QtGui.QCursor(QtGui.QPixmap(path))
	_cursorCache[name]=cursor
	return cursor