本文整理汇总了Python中PySide.QtDeclarative.QDeclarativeView.setPalette方法的典型用法代码示例。如果您正苦于以下问题:Python QDeclarativeView.setPalette方法的具体用法?Python QDeclarativeView.setPalette怎么用?Python QDeclarativeView.setPalette使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PySide.QtDeclarative.QDeclarativeView
的用法示例。
在下文中一共展示了QDeclarativeView.setPalette方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: OverlayWidget
# 需要导入模块: from PySide.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PySide.QtDeclarative.QDeclarativeView import setPalette [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: __init__
# 需要导入模块: from PySide.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PySide.QtDeclarative.QDeclarativeView import setPalette [as 别名]
def __init__(self, *args):
super(OverlayWidget, self).__init__(*args)
# 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)
qml_view = QDeclarativeView(self)
qml_view.setPalette(palette)
url = QUrl('control_slides.qml')
qml_view.setSource(url)
return
示例3: __init__
# 需要导入模块: from PySide.QtDeclarative import QDeclarativeView [as 别名]
# 或者: from PySide.QtDeclarative.QDeclarativeView import setPalette [as 别名]
def __init__(self, *args):
super(OverlayWidget, self).__init__(*args)
# 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)
qml_view = QDeclarativeView(self)
qml_view.setPalette(palette)
qml_context = qml_view.rootContext()
qml_context.setContextProperty("slider_handler", self)
url = QUrl('control_slides.qml')
qml_view.setSource(url)
qml_root = qml_view.rootObject()
self.x_rotation_changed.connect(qml_root.x_rotation_changed)
self.y_rotation_changed.connect(qml_root.y_rotation_changed)
self.z_rotation_changed.connect(qml_root.z_rotation_changed)
return