Not able to open website in the same window on button click in pyqt5 application

-1

I am trying to make a pyqt5 standalone app which looks like the one shown in the image.

Image Link

I want to open "Google" website on clicking URL1 button in the space present on the right side of the window.

Code for Button under initUI Function:

URL1_button = QPushButton('URL1', self)
URL1_button.setToolTip('Check URL1')
URL1_button.clicked.connect(self.URL1_on_click)

Code for URL1_on_cLick under main class:

def URL1_on_click(self):
     self.web.load(QUrl("https://google.com"))
     self.web.show()

Grid for button under initUI func:

grid.addWidget(URL1_button, 1, 0)

Grid for website loader space under initUI func:

grid.addWidget(web, 1, 2, 30, 30)

Web widget under initUI func:

web = QWebEngineView()

When I click on the URL1 Button the application closes automatically after few seconds with a message. Error Message:

Process finished with exit code -1073740791 (0xC0000409)

Please help me solve this issue

python
python-3.x
pyqt
pyqt5
qwebengineview
asked on Stack Overflow Aug 3, 2019 by Siddarth Patil • edited Aug 3, 2019 by Siddarth Patil

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0