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


Python QDeclarativeView.setPalette方法代码示例

本文整理汇总了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())
开发者ID:hgomersall,项目名称:Blog-Code,代码行数:28,代码来源:dynamic_drawer_test.py

示例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
开发者ID:hgomersall,项目名称:Blog-Code,代码行数:17,代码来源:overlay_widget_simple.py

示例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
开发者ID:hgomersall,项目名称:Blog-Code,代码行数:25,代码来源:qml_with_hellogl_with_shader.py


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