(cls, widget, name='default.png')
| 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'): |