Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. How to avoid qtwebengine to crash main program?

How to avoid qtwebengine to crash main program?

Scheduled Pinned Locked Moved Unsolved QtWebEngine
7 Posts 4 Posters 1.6k 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.
  • Y Offline
    Y Offline
    yetanotherqtfan
    wrote on last edited by yetanotherqtfan
    #1

    I load many urls in a QWebEngineView object, one by one. Some urls are displayed normally, some will make my app crash. I do not know if it is a Qt problem or chromium problem. But can I avoid qtwebengine to crash main program so I can continue to load the following urls? It should be something like:

    for(i=0;i<100;i++)
        {
            try
            {
                view->load(urls[i]);
            }
            catch(...)
            {
            }
        }
    

    But since QWebEngineView::load is an asynchronous function, I could not use the above code to ignore the failed url.

    JonBJ DJBob GamingD 2 Replies Last reply
    0
    • Y yetanotherqtfan

      I load many urls in a QWebEngineView object, one by one. Some urls are displayed normally, some will make my app crash. I do not know if it is a Qt problem or chromium problem. But can I avoid qtwebengine to crash main program so I can continue to load the following urls? It should be something like:

      for(i=0;i<100;i++)
          {
              try
              {
                  view->load(urls[i]);
              }
              catch(...)
              {
              }
          }
      

      But since QWebEngineView::load is an asynchronous function, I could not use the above code to ignore the failed url.

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

      @yetanotherqtfan
      If it is genuinely "crashing" I don't think you will be able to do much about it. You can use some of the QWebEngineView::load...() signals to monitor how far it is getting, but that's about it, and it won't affect the behaviour anyway. You could Google for qwebengineview crash, there are a few hits, you could see whether your situation corresponds to any of them.

      1 Reply Last reply
      1
      • Y Offline
        Y Offline
        yetanotherqtfan
        wrote on last edited by
        #3

        @JonB Thank you for your suggestion. I would like to know if there is a method to bypass the error and continue to load subsequent urls. Is there any exception thrown by QtWebEngine that can be caught? If there is, how can I catch those exceptions?

        JonBJ 1 Reply Last reply
        0
        • Y yetanotherqtfan

          @JonB Thank you for your suggestion. I would like to know if there is a method to bypass the error and continue to load subsequent urls. Is there any exception thrown by QtWebEngine that can be caught? If there is, how can I catch those exceptions?

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

          @yetanotherqtfan
          As I said, I'm afraid not to the best of my knowledge.

          You might try running your app inside debugger to get backtrace on crash. It sometimes gives a clue. I think one thing to make sure is that you have up-to-date graphics card driver. Also, you might see whether same page crashes inside Google as from QWebEngine: in principle I would expect Chromium engine to behave similarly....

          1 Reply Last reply
          0
          • J Offline
            J Offline
            juri.valdmann
            wrote on last edited by
            #5

            QtWebEngine should not crash your app. Please file a bug report with a sample program at bugreports.qt.io.

            1 Reply Last reply
            0
            • Y yetanotherqtfan

              I load many urls in a QWebEngineView object, one by one. Some urls are displayed normally, some will make my app crash. I do not know if it is a Qt problem or chromium problem. But can I avoid qtwebengine to crash main program so I can continue to load the following urls? It should be something like:

              for(i=0;i<100;i++)
                  {
                      try
                      {
                          view->load(urls[i]);
                      }
                      catch(...)
                      {
                      }
                  }
              

              But since QWebEngineView::load is an asynchronous function, I could not use the above code to ignore the failed url.

              DJBob GamingD Offline
              DJBob GamingD Offline
              DJBob Gaming
              Banned
              wrote last edited by
              #6
              This post is deleted!
              JonBJ 1 Reply Last reply
              0
              • DJBob GamingD DJBob Gaming

                This post is deleted!

                JonBJ Offline
                JonBJ Offline
                JonB
                wrote last edited by
                #7

                @DJBob-Gaming Is this spam? Does not sound like any answer to the question.

                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