Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt for Python
  4. What's the problem with this code? Works for pyqt5 but not for pyqt6.
Forum Updated to NodeBB v4.3 + New Features

What's the problem with this code? Works for pyqt5 but not for pyqt6.

Scheduled Pinned Locked Moved Unsolved Qt for Python
7 Posts 3 Posters 1.3k Views 1 Watching
  • 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.
  • A Offline
    A Offline
    Aksaht
    wrote on last edited by
    #1

    When I run everything works fine except it stops at instagram splash/loading screen, even the right click menu option don't work.ff.PNG

    *Note the output come everytime same in every pyqt app

    • There is no problem with internet connection.
    import sys
    
    from PyQt6.QtWidgets import *
    from PyQt6.QtWebEngineWidgets import QWebEngineView
    from PyQt6.QtWebEngineCore import QWebEnginePage, QWebEngineProfile
    from PyQt6.QtCore import QUrl
    
    
    class Main(QWebEngineView):
        def __init__(self):
            super().__init__()
            self.profile = QWebEngineProfile("data", self) # Create a off-road profile with parent self
            self.profile.setPersistentCookiesPolicy
            (QWebEngineProfile.PersistentCookiesPolicy.AllowPersistentCookies) # Force the cookie to be stored in disk
            self.profile.setHttpCacheType(QWebEngineProfile.HttpCacheType.DiskHttpCache) # Cache is stored in disk
            self.profile.setPersistentStoragePath('data') # Cookie path in data folder in root
            self.profile.setCachePath('data') # Cache path in data folder in root
    
            self.page = QWebEnginePage(self.profile) # Create a page with profile from above
            self.setPage(self.page) # not set page to QWebEngineView
            self.load(QUrl("https://www.instagram.com")) # load the url in view
            self.show()
    
    
    app = QApplication(sys.argv)
    main = Main()
    app.exec()
    

    #qwebengine

    SGaistS 1 Reply Last reply
    0
    • A Aksaht

      When I run everything works fine except it stops at instagram splash/loading screen, even the right click menu option don't work.ff.PNG

      *Note the output come everytime same in every pyqt app

      • There is no problem with internet connection.
      import sys
      
      from PyQt6.QtWidgets import *
      from PyQt6.QtWebEngineWidgets import QWebEngineView
      from PyQt6.QtWebEngineCore import QWebEnginePage, QWebEngineProfile
      from PyQt6.QtCore import QUrl
      
      
      class Main(QWebEngineView):
          def __init__(self):
              super().__init__()
              self.profile = QWebEngineProfile("data", self) # Create a off-road profile with parent self
              self.profile.setPersistentCookiesPolicy
              (QWebEngineProfile.PersistentCookiesPolicy.AllowPersistentCookies) # Force the cookie to be stored in disk
              self.profile.setHttpCacheType(QWebEngineProfile.HttpCacheType.DiskHttpCache) # Cache is stored in disk
              self.profile.setPersistentStoragePath('data') # Cookie path in data folder in root
              self.profile.setCachePath('data') # Cache path in data folder in root
      
              self.page = QWebEnginePage(self.profile) # Create a page with profile from above
              self.setPage(self.page) # not set page to QWebEngineView
              self.load(QUrl("https://www.instagram.com")) # load the url in view
              self.show()
      
      
      app = QApplication(sys.argv)
      main = Main()
      app.exec()
      

      #qwebengine

      SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi and welcome to devnet,

      Did you also check with PySide6 ?

      PyQt is from Riverbank Computing so if there's a regression, you should check with them directly.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      0
      • SGaistS SGaist

        Hi and welcome to devnet,

        Did you also check with PySide6 ?

        PyQt is from Riverbank Computing so if there's a regression, you should check with them directly.

        A Offline
        A Offline
        Aksaht
        wrote on last edited by
        #3

        @SGaist Not working still 😔

        JonBJ 1 Reply Last reply
        0
        • A Aksaht

          @SGaist Not working still 😔

          JonBJ Offline
          JonBJ Offline
          JonB
          wrote on last edited by
          #4

          @Aksaht Does this mean you were able to try with PySide6, as @SGaist asked, and it is not working there as under PyQt6?

          A 1 Reply Last reply
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            Your storage paths are the problem.

            Interested in AI ? www.idiap.ch
            Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

            SGaistS 1 Reply Last reply
            1
            • JonBJ JonB

              @Aksaht Does this mean you were able to try with PySide6, as @SGaist asked, and it is not working there as under PyQt6?

              A Offline
              A Offline
              Aksaht
              wrote on last edited by
              #6

              @JonB No PySide6 did'nt made any difference.

              1 Reply Last reply
              0
              • SGaistS SGaist

                Your storage paths are the problem.

                SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                @SGaist said in What's the problem with this code? Works for pyqt5 but not for pyqt6.:

                Your storage paths are the problem.

                Make them point in a suitable folder (e.g. one that you have write access to) and it works.

                Interested in AI ? www.idiap.ch
                Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                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