0

Faced a strange issue with QWebEngineView: I have a qt ui file with a style sheet in it, which has a border defined. When loaded in python it looks as it should. The file holds a frame in it. As soon as I add a QWebEngineView to the frame, the border of the main widget disappears on top, right and bottom. On the left side it's still there. Anyone knows that issue?

Thats my code:

class ViewWindow(QWidget):
    def __init__(self):
        super(ViewWindow, self).__init__()
        loader = QUiLoader()
        file = QFile(abspath("ui/view.ui"))
        file.open(QFile.ReadOnly)
        self.view_screen = loader.load(file, self)
        file.close()
        self.initUI()

    def initUI(self):
        self.setWindowFlags(Qt.Window | Qt.FramelessWindowHint)
        self.layout = QHBoxLayout()
        self.browser=QWebEngineView()
        self.browser.setUrl(QUrl("https://www.google.at"))
        self.layout.addWidget(self.browser)
        self.browser.hide()
        self.view_screen.pushButton.clicked.connect(self.browser.show)
        self.view_screen.frame.setLayout(self.layout)

app = QApplication(sys.argv)
view = ViewWindow()
view.show()
sys.exit(app.exec_())

Thanks.

van neilsen
  • 547
  • 8
  • 21
dhirczy87
  • 33
  • 1
  • 7

1 Answers1

0

It was an issue with my pc. Tried on another windows 7 machine and it works like a charm.

Thanks

dhirczy87
  • 33
  • 1
  • 7