當前位置: 首頁>>代碼示例>>Python>>正文


Python QtCompat.load_ui方法代碼示例

本文整理匯總了Python中Qt.QtCompat.load_ui方法的典型用法代碼示例。如果您正苦於以下問題:Python QtCompat.load_ui方法的具體用法?Python QtCompat.load_ui怎麽用?Python QtCompat.load_ui使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Qt.QtCompat的用法示例。


在下文中一共展示了QtCompat.load_ui方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from Qt import QtCompat [as 別名]
# 或者: from Qt.QtCompat import load_ui [as 別名]
    def __init__(self):
        super(Dialog, self).__init__()

        layout = QtWidgets.QVBoxLayout(self)
        layout.setContentsMargins(0, 10, 0, 0)
        fname = os.path.splitext(__file__)[0] + ".ui"
        self.ui = QtCompat.load_ui(fname=fname)
        layout.addWidget(self.ui)

        self.create_connections()
開發者ID:Bumpybox,項目名稱:Tapp,代碼行數:12,代碼來源:dialog.py

示例2: __init__

# 需要導入模塊: from Qt import QtCompat [as 別名]
# 或者: from Qt.QtCompat import load_ui [as 別名]
    def __init__(self):
        super(PackageDialog, self).__init__()

        main_layout = QtGui.QVBoxLayout(self)
        self.mainWidget = QtCompat.load_ui(ui_path)
        self.setWindowTitle(self.mainWidget.windowTitle())
        main_layout.addWidget(self.mainWidget)

        self.mainWidget.FileButton.clicked.connect(self.on_FileButton_clicked)
        self.mainWidget.packButton.clicked.connect(self.on_packButton_clicked)
        self.mainWidget.cancelButton.clicked.connect(self.close)
開發者ID:weijer,項目名稱:NukeToolSet,代碼行數:13,代碼來源:nuke2pack.py

示例3: setup_ui

# 需要導入模塊: from Qt import QtCompat [as 別名]
# 或者: from Qt.QtCompat import load_ui [as 別名]
def setup_ui(uifile, base_instance=None):
    """Load a Qt Designer .ui file and returns an instance of the user interface

    Args:
        uifile (str): Absolute path to .ui file
        base_instance (QWidget): The widget into which UI widgets are loaded

    Returns:
        QWidget: the base instance

    """
    ui = QtCompat.load_ui(uifile)  # Qt.py mapped function
    if not base_instance:
        return ui
    else:
        for member in dir(ui):
            if not member.startswith('__') and \
               member is not 'staticMetaObject':
                setattr(base_instance, member, getattr(ui, member))
        return ui
開發者ID:boberfly,項目名稱:gafferDependencies,代碼行數:22,代碼來源:baseinstance1.py


注:本文中的Qt.QtCompat.load_ui方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。