本文整理汇总了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)])