Exemple #1
0
 def ui(self):
     layout = QVBoxLayout(self)
     layout.setContentsMargins(0, 0, 0, 0)
     widget = QQuickWidget(self)
     widget.setContentsMargins(0, 0, 0, 0)
     widget.rootContext().setContextProperty('self', self.obj)
     widget.setSource(QUrl(self.qml))
     layout.addWidget(widget)
     return layout
Exemple #2
0
    def ui(self):
        layout = QVBoxLayout(self)
        layout.setContentsMargins(0, 0, 0, 0)
        widget = QQuickWidget(self)
        widget.setContentsMargins(0, 0, 0, 0)
        widget.rootContext().setContextProperty('self', self.obj)
        widget.setSource(QtCore.QUrl(self.qml))
        layout.addWidget(widget)
        pdsWidget = ProductList(self.products)

        width = 750
        pdsWidget.setMinimumWidth(width)
        pdsWidget.setMaximumWidth(width)

        product_layout = QHBoxLayout(self)
        product_layout.setContentsMargins(0, 0, 0, 0)
        product_layout.addSpacing(30)
        product_layout.addWidget(pdsWidget)
        product_layout.addStretch(1)

        layout.addLayout(product_layout)
        layout.addStretch(1)
        return layout