MCPcopy Index your code
hub / github.com/PyQt5/PyQtClient / loadCursor

Method loadCursor

Utils/ThemeManager.py:382–393  ·  view source on GitHub ↗
(cls, widget, name='default.png')

Source from the content-addressed store, hash-verified

380
381 @classmethod
382 def loadCursor(cls, widget, name='default.png'):
383 # 加载光标
384 path = cls.cursorPath(name)
385 if path in ThemeManager.Cursors:
386 widget.setCursor(ThemeManager.Cursors[path])
387 return
388 AppLog.info('cursorPath: {}'.format(path))
389 if os.path.exists(path):
390 # 设置自定义鼠标样式,并以0,0为原点
391 cur = QCursor(QPixmap(path), 0, 0)
392 ThemeManager.Cursors[path] = cur
393 widget.setCursor(cur)
394
395 @classmethod
396 def cursorPath(cls, name='default.png'):

Callers 12

_initUiMethod · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80
__init__Method · 0.80

Calls 1

cursorPathMethod · 0.80

Tested by 2

__init__Method · 0.64
__init__Method · 0.64