本文整理匯總了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()
示例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)
示例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