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


Python QtUiTools.QUiLoader方法代码示例

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


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

示例1: _pyside2

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [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

示例2: _pyside2

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [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: __init__

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [as 别名]
def __init__( self, parent = BT_GetMayaWindow() ):
        super(BT_UIForm, self).__init__(parent)

        uicPath = BT_FindUIFile()

        if not uicPath:
            return None

        self.ui = None
        if BT_MayaVersionNumber < 2014:
            self.ui = uic.loadUi(uicPath, self)
        else:
            loader = QtUiTools.QUiLoader()
            self.ui = loader.load(uicPath, self)

        self.ui.loadSelectedButton.clicked.connect(self.loadSelectedSet)
        self.ui.connectButton.clicked.connect(self.connectSetup)
        self.ui.disconnectButton.clicked.connect(self.disconnectSetup)
        self.ui.setToBaseButton.clicked.connect(self.setToBasePose)
        self.ui.setToSelectedButton.clicked.connect(self.setToPose)
        self.ui.addPoseButton.clicked.connect(self.addPose)
        self.ui.deletePoseButton.clicked.connect(self.deletePose)
        self.ui.updateSelectedButton.clicked.connect(self.updatePose)

        unitResult = BT_SetUnits()
        if unitResult:
            QtGui.QMessageBox.warning(self, "Blend Transforms", "Units set to centimetres.", "Okay")

        self.ui.show() 
开发者ID:duncanskertchly,项目名称:BlendTransforms,代码行数:31,代码来源:BlendTransforms.py

示例4: _pyside_loadui

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [as 别名]
def _pyside_loadui(fname):
    '''
    this function is for PySide load_ui bug when there are custom widgets in the ui file
    '''
    import PySide.QtUiTools as QtUiTools
    import importlib
    loader = QtUiTools.QUiLoader()
    # get custom_widget
    with open(fname) as ui_file:
        all_xml = ui_file.read()
        custom_wgt_xmls = re.findall(r'<customwidget>.*?</customwidget>', all_xml, re.S)
        for cus_wgt_xml in custom_wgt_xmls:
            class_search = re.search(r"<class>(.*?)</class>", cus_wgt_xml, re.S)
            class_name = class_search.group(1)
            module_search = re.search(r"<header.*>(.*?)</header>", cus_wgt_xml, re.S)
            module_name = module_search.group(1).replace("/", ".")
            # import and register
            module = importlib.import_module(module_name)
            loader.registerCustomWidget(getattr(module, class_name))
    return loader.load(fname) 
开发者ID:cineuse,项目名称:CNCGToolKit,代码行数:22,代码来源:Qt.py

示例5: QtLoadUI

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [as 别名]
def QtLoadUI(uifile):
        from PySide import QtUiTools
        loader = QtUiTools.QUiLoader()
        uif = QtCore.QFile(uifile)
        uif.open(QtCore.QFile.ReadOnly)
        result = loader.load(uif)
        uif.close()
        return result 
开发者ID:CALFEM,项目名称:calfem-python,代码行数:10,代码来源:QtVariant.py

示例6: _pyside

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [as 别名]
def _pyside():
    import PySide
    from PySide import QtGui, QtCore, QtUiTools

    _remap(PySide, "QtWidgets", QtGui)
    _remap(QtCore, "QSortFilterProxyModel", QtGui.QSortFilterProxyModel)
    _remap(QtCore, "QStringListModel", QtGui.QStringListModel)
    _remap(QtCore, "QItemSelection", QtGui.QItemSelection)
    _remap(QtCore, "QItemSelectionModel", QtGui.QItemSelectionModel)
    _remap(QtCore, "QAbstractProxyModel", QtGui.QAbstractProxyModel)

    try:
        from PySide import QtWebKit
        _remap(PySide, "QtWebKitWidgets", QtWebKit)
    except ImportError:
        # QtWebkit is optional in Qt, therefore might not be available
        pass

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

    _maintain_backwards_compatibility(PySide)

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

示例7: __init__

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [as 别名]
def __init__(self, parent=None):
        super(BaseTab, self).__init__(parent)
        #self.parent = parent
        #loader = QUiLoader()
        #f = QFile(uifile)
        #f.open(QFile.ReadOnly)
        #widget = loader.load(f, self)
        #f.close()
    
        #layout = QVBoxLayout()
        #layout.addWidget(widget)
        #self.setLayout(layout)
        #utils.loadUi(uifile)
    
    #---------------------------------------------------------------------- 
开发者ID:WebberHuang,项目名称:DeformationLearningSolver,代码行数:17,代码来源:baseTab.py

示例8: __init__

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [as 别名]
def __init__(self, cb_ok, cb_fail): 
            super(IDASynergyConfigUI, self).__init__()
            self.loader = QUiLoader()
            self.initUI()
            self.ui.buttonBox.accepted.connect(cb_ok)
            self.ui.buttonBox.rejected.connect(cb_fail) 
开发者ID:CubicaLabs,项目名称:IDASynergy,代码行数:8,代码来源:IDASynergy.py

示例9: _pyside2_load_ui

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [as 别名]
def _pyside2_load_ui(fyle, parent=None):
    from PySide2.QtUiTools import QUiLoader
    loader = QUiLoader()
    return loader.load(fyle, parent) 
开发者ID:theodox,项目名称:mGui,代码行数:6,代码来源:_compat.py

示例10: _pyside_load_ui

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [as 别名]
def _pyside_load_ui(fyle, parent=None):
    from PySide.QtUiTools import QUiLoader
    loader = QUiLoader()
    return loader.load(fyle, parent) 
开发者ID:theodox,项目名称:mGui,代码行数:6,代码来源:_compat.py

示例11: _pyside

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [as 别名]
def _pyside():
    import PySide
    from PySide import QtGui, QtCore, QtUiTools

    _remap(PySide, "QtWidgets", QtGui)
    _remap(QtCore, "QSortFilterProxyModel", QtGui.QSortFilterProxyModel)
    _remap(QtCore, "QStringListModel", QtGui.QStringListModel)
    _remap(QtCore, "QItemSelection", QtGui.QItemSelection)
    _remap(QtCore, "QItemSelectionModel", QtGui.QItemSelectionModel)
    _remap(QtCore, "QAbstractProxyModel", QtGui.QAbstractProxyModel)

    try:
        from PySide import QtWebKit
        _remap(PySide, "QtWebKitWidgets", QtWebKit)
    except ImportError:
        "QtWebkit is optional in Qt, therefore might not be available"

    _add(QtCompat, "__binding__", PySide.__name__)
    _add(QtCompat, "__binding_version__", PySide.__version__)
    _add(QtCompat, "__qt_version__", PySide.QtCore.qVersion())
    _add(QtCompat, "load_ui", lambda fname: QtUiTools.QUiLoader().load(fname))
    _add(QtCompat, "setSectionResizeMode", QtGui.QHeaderView.setResizeMode)

    _add(QtCompat, "translate",
         lambda context, sourceText, disambiguation, n:
         QtCore.QCoreApplication.translate(context,
                                           sourceText,
                                           disambiguation,
                                           QtCore.QCoreApplication.CodecForTr,
                                           n))

    _maintain_backwards_compatibility(PySide)

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

示例12: widgetFromUIFile

# 需要导入模块: from PySide import QtUiTools [as 别名]
# 或者: from PySide.QtUiTools import QUiLoader [as 别名]
def widgetFromUIFile(filePath):
        """
        Reads an ``.ui`` file and creates a new widget object from it.

        :param filePath: Where to find the ``.ui`` file
        :return: The new created widget
        """

        loader = QUiLoader()
        UIFile = QFile(filePath)
        UIFile.open(QFile.ReadOnly)
        widget = loader.load(UIFile)
        UIFile.close()
        return widget 
开发者ID:schutzwerk,项目名称:CANalyzat0r,代码行数:16,代码来源:Toolbox.py


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