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


Python QQuickView.setTransientParent方法代码示例

本文整理汇总了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
开发者ID:bootchk,项目名称:documentStyle,代码行数:16,代码来源:qmlMaster.py

示例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
开发者ID:GrandHsu,项目名称:demoQMLPyQt,代码行数:22,代码来源:qmlMaster.py


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