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


Python PySide2.__name__方法代码示例

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


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

示例1: _setup

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def _setup(module, extras):
    """Install common submodules"""

    Qt.__binding__ = module.__name__

    for name in list(_common_members) + extras:
        try:
            submodule = _import_sub_module(
                module, name)
        except ImportError:
            try:
                # For extra modules like sip and shiboken that may not be
                # children of the binding.
                submodule = __import__(name)
            except ImportError:
                continue

        setattr(Qt, "_" + name, submodule)

        if name not in extras:
            # Store reference to original binding,
            # but don't store speciality modules
            # such as uic or QtUiTools
            setattr(Qt, name, _new_module(name)) 
开发者ID:getavalon,项目名称:core,代码行数:26,代码来源:Qt.py

示例2: _pyside2

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def _pyside2():
    import PySide2
    from PySide2 import QtGui, QtWidgets, QtCore, QtUiTools

    _remap(QtCore, "QStringListModel", QtGui.QStringListModel)

    _add(PySide2, "__binding__", PySide2.__name__)
    _add(PySide2, "load_ui", lambda fname: QtUiTools.QUiLoader().load(fname))
    _add(PySide2, "translate", lambda context, sourceText, disambiguation, n: (
        QtCore.QCoreApplication(context, sourceText,
                                disambiguation, None, n)))
    _add(PySide2,
         "setSectionResizeMode",
         QtWidgets.QHeaderView.setSectionResizeMode)

    _maintain_backwards_compatibility(PySide2)

    return PySide2 
开发者ID:liorbenhorin,项目名称:pipeline,代码行数:20,代码来源:Qt.py

示例3: _setup

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def _setup(module, extras):
    """Install common submodules"""

    Qt.__binding__ = module.__name__

    for name in list(_common_members) + extras:
        try:
            submodule = importlib.import_module(
                module.__name__ + "." + name)
        except ImportError:
            continue

        setattr(Qt, "_" + name, submodule)

        if name not in extras:
            # Store reference to original binding,
            # but don't store speciality modules
            # such as uic or QtUiTools
            setattr(Qt, name, _new_module(name)) 
开发者ID:weijer,项目名称:NukeToolSet,代码行数:21,代码来源:Qt.py

示例4: _pyqt5

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def _pyqt5():
    import PyQt5.Qt
    from PyQt5 import QtCore, QtWidgets, uic

    _remap(QtCore, "Signal", QtCore.pyqtSignal)
    _remap(QtCore, "Slot", QtCore.pyqtSlot)
    _remap(QtCore, "Property", QtCore.pyqtProperty)

    _add(PyQt5, "__binding__", PyQt5.__name__)
    _add(PyQt5, "load_ui", lambda fname: uic.loadUi(fname))
    _add(PyQt5, "translate", lambda context, sourceText, disambiguation, n: (
        QtCore.QCoreApplication(context, sourceText,
                                disambiguation, n)))
    _add(PyQt5,
         "setSectionResizeMode",
         QtWidgets.QHeaderView.setSectionResizeMode)

    _maintain_backwards_compatibility(PyQt5)

    return PyQt5 
开发者ID:chrisevans3d,项目名称:uExport,代码行数:22,代码来源:Qt.py

示例5: _setup

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def _setup(module, extras):
    """Install common submodules"""

    Qt.__binding__ = module.__name__

    for name in list(_common_members) + extras:
        try:
            # print("Trying %s" % name)
            submodule = importlib.import_module(
                module.__name__ + "." + name)
        except ImportError:
            # print("Failed %s" % name)
            continue

        setattr(Qt, "_" + name, submodule)

        if name not in extras:
            # Store reference to original binding,
            # but don't store speciality modules
            # such as uic or QtUiTools
            setattr(Qt, name, _new_module(name)) 
开发者ID:TomMinor,项目名称:P4VFX,代码行数:23,代码来源:Qt.py

示例6: _pyside2

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def _pyside2():
    import PySide2
    from PySide2 import QtGui, QtWidgets, QtCore, QtUiTools

    _remap(QtCore, "QStringListModel", QtGui.QStringListModel)

    _add(QtCompat, "__binding__", PySide2.__name__)
    _add(QtCompat, "__binding_version__", PySide2.__version__)
    _add(QtCompat, "__qt_version__", PySide2.QtCore.qVersion())
    _add(QtCompat, "load_ui", lambda fname: QtUiTools.QUiLoader().load(fname))

    _add(QtCompat, "setSectionResizeMode",
         QtWidgets.QHeaderView.setSectionResizeMode)

    _add(QtCompat, "translate", QtCore.QCoreApplication.translate)

    _maintain_backwards_compatibility(PySide2)

    return PySide2 
开发者ID:pyblish,项目名称:pyblish-maya,代码行数:21,代码来源:Qt.py

示例7: _pyside2

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def _pyside2():
    import PySide2
    from PySide2 import QtGui, QtWidgets, QtCore, QtUiTools

    _remap(QtCore, "QStringListModel", QtGui.QStringListModel)

    _add(PySide2, "__binding__", PySide2.__name__)
    _add(PySide2, "load_ui", _pyside_loadui)
    _add(PySide2, "translate", lambda context, sourceText, disambiguation, n: (
        QtCore.QCoreApplication(context, sourceText,
                                disambiguation, None, n)))
    _add(PySide2,
         "setSectionResizeMode",
         QtWidgets.QHeaderView.setSectionResizeMode)

    _maintain_backwards_compatibility(PySide2)

    return PySide2 
开发者ID:cineuse,项目名称:CNCGToolKit,代码行数:20,代码来源:Qt.py

示例8: _new_module

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def _new_module(name):
    return types.ModuleType(__name__ + "." + name) 
开发者ID:getavalon,项目名称:core,代码行数:4,代码来源:Qt.py

示例9: _import_sub_module

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def _import_sub_module(module, name):
    """import_sub_module will mimic the function of importlib.import_module"""
    module = __import__(module.__name__ + "." + name)
    for level in name.split("."):
        module = getattr(module, level)
    return module 
开发者ID:getavalon,项目名称:core,代码行数:8,代码来源:Qt.py

示例10: _pyqt5

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def _pyqt5():
    """Initialise PyQt5"""

    import PyQt5 as module
    extras = ["uic"]
    try:
        import sip
        extras.append(sip.__name__)
    except ImportError:
        sip = None

    _setup(module, extras)
    if hasattr(Qt, "_sip"):
        Qt.QtCompat.wrapInstance = _wrapinstance
        Qt.QtCompat.getCppPointer = _getcpppointer
        Qt.QtCompat.delete = sip.delete

    if hasattr(Qt, "_uic"):
        Qt.QtCompat.loadUi = _loadUi

    if hasattr(Qt, "_QtCore"):
        Qt.__binding_version__ = Qt._QtCore.PYQT_VERSION_STR
        Qt.__qt_version__ = Qt._QtCore.QT_VERSION_STR

    if hasattr(Qt, "_QtWidgets"):
        Qt.QtCompat.setSectionResizeMode = \
            Qt._QtWidgets.QHeaderView.setSectionResizeMode

    _reassign_misplaced_members("PyQt5")
    _build_compatibility_members('PyQt5') 
开发者ID:getavalon,项目名称:core,代码行数:32,代码来源:Qt.py

示例11: __repr__

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def __repr__(self):
        return "<{}: {}>".format(self.__class__.__name__, self.__name) 
开发者ID:nilouco,项目名称:dpAutoRigSystem,代码行数:4,代码来源:Qt.py

示例12: _remap

# 需要导入模块: import PySide2 [as 别名]
# 或者: from PySide2 import __name__ [as 别名]
def _remap(object, name, value, safe=True):
    """Prevent accidental assignment of existing members

    Arguments:
        object (object): Parent of new attribute
        name (str): Name of new attribute
        value (object): Value of new attribute
        safe (bool): Whether or not to guarantee that
            the new attribute was not overwritten.
            Can be set to False under condition that
            it is superseded by extensive testing.

    """

    if os.getenv("QT_TESTING") is not None and safe:
        # Cannot alter original binding.
        if hasattr(object, name):
            raise AttributeError("Cannot override existing name: "
                                 "%s.%s" % (object.__name__, name))

        # Cannot alter classes of functions
        if type(object).__name__ != "module":
            raise AttributeError("%s != 'module': Cannot alter "
                                 "anything but modules" % object)

    elif hasattr(object, name):
        # Keep track of modifications
        self.__modified__.append(name)

    self.__remapped__.append(name)

    setattr(object, name, value) 
开发者ID:liorbenhorin,项目名称:pipeline,代码行数:34,代码来源:Qt.py


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