当前位置: 首页>>代码示例>>Python>>正文


Python QCoreApplication.setLibraryPaths方法代码示例

本文整理汇总了Python中PySide.QtCore.QCoreApplication.setLibraryPaths方法的典型用法代码示例。如果您正苦于以下问题:Python QCoreApplication.setLibraryPaths方法的具体用法?Python QCoreApplication.setLibraryPaths怎么用?Python QCoreApplication.setLibraryPaths使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PySide.QtCore.QCoreApplication的用法示例。


在下文中一共展示了QCoreApplication.setLibraryPaths方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: Python

# 需要导入模块: from PySide.QtCore import QCoreApplication [as 别名]
# 或者: from PySide.QtCore.QCoreApplication import setLibraryPaths [as 别名]
# This hook is an adapted version of pyi_rth_qt4plugins.py for PySide
import os

d = "qt4_plugins"

if "_MEIPASS2" in os.environ:
    d = os.path.join(os.environ["_MEIPASS2"], d)
else:
    d = os.path.join(os.path.dirname(sys.argv[0]), d)
# We remove QT_PLUGIN_PATH variable, beasuse we want Qt4 to load
# plugins only from one path.
os.environ['QT_PLUGIN_PATH'] = os.path.abspath(d)


# We cannot use QT_PLUGIN_PATH here, because it would not work when
# PyQt4 is compiled with a different CRT from Python (eg: it happens
# with Riverbank's GPL package).
from PySide.QtCore import QCoreApplication
# We set "qt4_plugins" as only one path for Qt4 plugins
QCoreApplication.setLibraryPaths([os.path.abspath(d)])
开发者ID:ssorgatem,项目名称:pyinstaller-1.5.1-with-patches,代码行数:22,代码来源:pyi_rth_pyside_qt4plugins.py


注:本文中的PySide.QtCore.QCoreApplication.setLibraryPaths方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。