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?
Forum Updated to NodeBB v4.3 + New Features

How to avoid qtwebengine to crash main program?

Scheduled Pinned Locked Moved Unsolved QtWebEngine
7 Posts 4 Posters 1.9k 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 21 Apr 2019, 13:18 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.

    J D 2 Replies Last reply 22 Apr 2019, 08:15
    0
    • Y yetanotherqtfan
      21 Apr 2019, 13:18

      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.

      J Offline
      J Offline
      JonB
      wrote on 22 Apr 2019, 08:15 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 22 Apr 2019, 09:40 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?

        J 1 Reply Last reply 22 Apr 2019, 11:07
        0
        • Y yetanotherqtfan
          22 Apr 2019, 09:40

          @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?

          J Offline
          J Offline
          JonB
          wrote on 22 Apr 2019, 11:07 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 26 Apr 2019, 08:28 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
              21 Apr 2019, 13:18

              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.

              D Offline
              D Offline
              DJBob Gaming
              Banned
              wrote on 2 May 2025, 12:19 last edited by
              #6
              This post is deleted!
              J 1 Reply Last reply 2 May 2025, 12:22
              0
              • D DJBob Gaming
                2 May 2025, 12:19

                This post is deleted!

                J Offline
                J Offline
                JonB
                wrote on 2 May 2025, 12:22 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