本文整理汇总了Python中python_qt_binding.QtGui.QIcon.setThemeName方法的典型用法代码示例。如果您正苦于以下问题:Python QIcon.setThemeName方法的具体用法?Python QIcon.setThemeName怎么用?Python QIcon.setThemeName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类python_qt_binding.QtGui.QIcon
的用法示例。
在下文中一共展示了QIcon.setThemeName方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: _check_icon_theme_compliance
# 需要导入模块: from python_qt_binding.QtGui import QIcon [as 别名]
# 或者: from python_qt_binding.QtGui.QIcon import setThemeName [as 别名]
def _check_icon_theme_compliance(self):
from python_qt_binding.QtGui import QIcon
# TODO find a better way to verify Theme standard compliance
if QIcon.themeName() == '' or \
QIcon.fromTheme('document-save').isNull() or \
QIcon.fromTheme('document-open').isNull() or \
QIcon.fromTheme('edit-cut').isNull() or \
QIcon.fromTheme('object-flip-horizontal').isNull():
if 'darwin' in platform.platform().lower() and '/usr/local/share/icons' not in QIcon.themeSearchPaths():
QIcon.setThemeSearchPaths(QIcon.themeSearchPaths() + ['/usr/local/share/icons'])
original_theme = QIcon.themeName()
QIcon.setThemeName('Tango')
if QIcon.fromTheme('document-save').isNull():
QIcon.setThemeName(original_theme)