PySide PyQt 版本基本兼容处理

PySide PyQt 版本基本兼容处理

# -*- coding: utf-8 -*-

try:
    from PySide import QtCore, QtGui
    from PySide import QtGui as QtWidgets
except:
    from PySide2 import QtWidgets, QtCore, QtGui
    
try:
    try:
        import shiboken
    except:
        from PySide import shiboken    
except:
    try:
        import shiboken2 as shiboken
    except:
        from PySide2 import shiboken2 as shiboken
未经博主允许,禁止直接转载本博客任何内容(可以在文章中添加链接,禁止原文照搬),如需直接原文转载对应文章,请在该文章中留言联系博主,谢谢!!
原文地址:https://www.cnblogs.com/ibingshan/p/14784167.html