本文整理汇总了Python中PyQt5.QtQuick.QQuickView.setTransientParent方法的典型用法代码示例。如果您正苦于以下问题:Python QQuickView.setTransientParent方法的具体用法?Python QQuickView.setTransientParent怎么用?Python QQuickView.setTransientParent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtQuick.QQuickView
的用法示例。
在下文中一共展示了QQuickView.setTransientParent方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: createQuickView
# 需要导入模块: from PyQt5.QtQuick import QQuickView [as 别名]
# 或者: from PyQt5.QtQuick.QQuickView import setTransientParent [as 别名]
def createQuickView(self, transientParent=None):
"""
Create empty QQuickView.
More robust: connects to error.
Subsequently, you should set context and then setSource()
"""
result = QQuickView()
result.statusChanged.connect(self.onStatusChanged)
assert transientParent is not None
print("transientParent is:", transientParent, transientParent.isTopLevel())
result.setTransientParent(transientParent)
assert result is not None
assert isinstance(result, QQuickView)
return result
示例2: quickViewForQML
# 需要导入模块: from PyQt5.QtQuick import QQuickView [as 别名]
# 或者: from PyQt5.QtQuick.QQuickView import setTransientParent [as 别名]
def quickViewForQML(self, qmlFilename, transientParent=None):
'''
Create a QQuickView for qmlFilename.
More robust: connects to error
'''
quickView = QQuickView()
quickView.statusChanged.connect(self.onStatusChanged)
qurl = resourceMgr.urlToQMLResource(resourceSubpath=qmlFilename)
quickView.setSource(qurl)
'''
Show() the enclosing QWindow?
But this means the window for e.g. the toolbar is visible separately?
'''
#quickView.show()
print("Created QQuickView for:", qurl.path())
if transientParent is not None:
quickView.setTransientParent(transientParent)
return quickView