Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QWebEngineView window won't show
QtWS25 Last Chance

QWebEngineView window won't show

Scheduled Pinned Locked Moved Unsolved General and Desktop
3 Posts 2 Posters 897 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • F Offline
    F Offline
    freethewall
    wrote on last edited by freethewall
    #1

    I wrote a simple test program to load a URL in a QWebEngineView. The program works on Mac; the browser pops up and I can see the webpage. But on Windows 7, the browser window never appears after I call show():

    import sys
    
    from PyQt5.QtWidgets import QApplication
    from PyQt5.QtWebEngineWidgets import QWebEngineView
    from PyQt5.QtCore import QUrl
    
    class Browser(QWebEngineView):
        def __init__(self):
            super().__init__()
            self.loadProgress.connect(print)
            self.load(QUrl('https://google.com'))
            self.loadFinished.connect(self.pageReady)
    
        def pageReady(self, success):
            if success:
                self.resize(640, 480)
                self.show()
            else:
                print('page failed to load')
    
    if __name__ == '__main__':
        app = QApplication(sys.argv)
        browser = Browser()
        app.exec_()
    

    Using self.loadProgress.connect(print), I verified that the page does reach 100% progress -- but the browser window never appears. My firewall is disabled, so there shouldn't be a connection problem.

    I'm on Windows 7, using PyQt5 (5.12.1), PyQt5-sip (4.19.15), and PyQtWebEngine (5.12.1). I installed them by running:
    pip install pyqt5
    pip install PyQtWebEngine
    I did not install Qt separately.
    I also tried PyQt5 5.12 without success.

    jsulmJ 1 Reply Last reply
    0
    • F freethewall

      I wrote a simple test program to load a URL in a QWebEngineView. The program works on Mac; the browser pops up and I can see the webpage. But on Windows 7, the browser window never appears after I call show():

      import sys
      
      from PyQt5.QtWidgets import QApplication
      from PyQt5.QtWebEngineWidgets import QWebEngineView
      from PyQt5.QtCore import QUrl
      
      class Browser(QWebEngineView):
          def __init__(self):
              super().__init__()
              self.loadProgress.connect(print)
              self.load(QUrl('https://google.com'))
              self.loadFinished.connect(self.pageReady)
      
          def pageReady(self, success):
              if success:
                  self.resize(640, 480)
                  self.show()
              else:
                  print('page failed to load')
      
      if __name__ == '__main__':
          app = QApplication(sys.argv)
          browser = Browser()
          app.exec_()
      

      Using self.loadProgress.connect(print), I verified that the page does reach 100% progress -- but the browser window never appears. My firewall is disabled, so there shouldn't be a connection problem.

      I'm on Windows 7, using PyQt5 (5.12.1), PyQt5-sip (4.19.15), and PyQtWebEngine (5.12.1). I installed them by running:
      pip install pyqt5
      pip install PyQtWebEngine
      I did not install Qt separately.
      I also tried PyQt5 5.12 without success.

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on last edited by
      #2

      @freethewall Did you verify that pageReady is called?

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      0
      • F Offline
        F Offline
        freethewall
        wrote on last edited by
        #3

        Yes, it is called, with success=True.

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved