本文整理汇总了Python中PySide.QtDeclarative.QDeclarativeView.resize方法的典型用法代码示例。如果您正苦于以下问题:Python QDeclarativeView.resize方法的具体用法?Python QDeclarativeView.resize怎么用?Python QDeclarativeView.resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtDeclarative.QDeclarativeView
的用法示例。
在下文中一共展示了QDeclarativeView.resize方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OverlayWidget
# 需要导入模块: from PySide.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PySide.QtDeclarative.QDeclarativeView import resize [as 别名]
class OverlayWidget(QtGui.QWidget):
def __init__(self, *args):
super(OverlayWidget, self).__init__(*args)
# Set this widget itself to be transparent
self.setAttribute(QtCore.Qt.WA_TranslucentBackground)
# We need to set the base colour of the qml widget to be transparent.
# This is done by setting its palette.
palette = QtGui.QPalette()
palette.setColor(QtGui.QPalette.Base, QtCore.Qt.transparent)
self.setPalette(palette)
self.qml_view = QDeclarativeView(self)
self.qml_view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
self.qml_view.setPalette(palette)
self.qml_view.setResizeMode(QDeclarativeView.SizeRootObjectToView)
url = QUrl('dynamic_drawers.qml')
self.qml_view.setSource(url)
def resizeEvent(self, event):
self.qml_view.resize(event.size())
示例2: main
# 需要导入模块: from PySide.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PySide.QtDeclarative.QDeclarativeView import resize [as 别名]
def main(argv):
app = QApplication(argv)
display_widget = QDeclarativeView()
display_widget.setViewport(QGLWidget())
display_widget.setResizeMode(QDeclarativeView.SizeRootObjectToView)
display_widget.setSource(QUrl('drawer_demo.qml'))
display_widget.show()
display_widget.resize(640,480)
sys.exit(app.exec_())
示例3: create
# 需要导入模块: from PySide.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PySide.QtDeclarative.QDeclarativeView import resize [as 别名]
def create(self, mimeType, url, argumentNames, argumentValues):
if mimeType != 'application/x-qml':
return None
for name, value in zip(argumentNames, argumentValues):
if name == 'width':
width = int(value)
elif name == 'height':
height = int(value)
view = QDeclarativeView()
view.resize(width, height)
view.setSource(url)
return view