Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. How to use a webview in a dynamic lib or a plugin
QtWS25 Last Chance

How to use a webview in a dynamic lib or a plugin

Scheduled Pinned Locked Moved Qt WebKit
4 Posts 2 Posters 4.0k 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.
  • D Offline
    D Offline
    dqiyy
    wrote on 22 Jan 2011, 14:46 last edited by
    #1

    We use QWebView for display Some Url in our applications. The QWebView is used in the dynamic lib inherate from QtPlugin, it is works fine for mac& Linux ,but on windows when we try to close the application ,the App crash, Accroding to the VC's debugging hint, we found that the delete of a Qobject WebCore::SharedTimerQt make the crash when the Qapplication object is deleted.

    Our App's strucure like this:
    App load A.DLL
    and A.DLL use the Qwebview just like
    QWebView * pView = new QWebView;
    pView->load(Url("Http://xxx.com"));

    I found that the default parent of the WebCore::SharedTimerQt is QCoreApplication, So when the A.dll is unloaded so the QWebKit4.dll is also unloaded by the application. So when the
    WebCore::SharedTimerQt is deleted when the application is closed, it is crash.

    Is there any way to use QWebView as a Plugin or a dynamic lib without make the depandece between the Main Application and the QWebKit4.dll?

    1 Reply Last reply
    0
    • B Offline
      B Offline
      benjamin.poulain
      wrote on 23 Jan 2011, 15:39 last edited by
      #2

      Do you do a proper tear down of the objects when the dll is unloaded? I would have thought the timer would be removed when the QWebPage is deleted.

      I am affraid this use case of running QtWebKit as plugin has never been tested. There are code path depending on delete later for example, so you would need to remove all the objects, wait a few event loop and unload the plugin.

      If you are willing to support WebKit as a plugin, I think you should start hacking and adding tests for that on webkit.org.

      1 Reply Last reply
      0
      • D Offline
        D Offline
        dqiyy
        wrote on 24 Jan 2011, 04:30 last edited by
        #3

        I have checked the code , and with debug information, that the QWebPage is delete (the destructor is called when debug). there is no other object based in QWebKit is used in the code. Is there any way to check all the object even created by qt self is deleted properly before the dll unloaded?
        Can someone told me the relationship between the QWebView-Load() and the Timer Object thanks a lot.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          benjamin.poulain
          wrote on 25 Jan 2011, 02:01 last edited by
          #4

          WebKit uses plenty of timers. It could be as simple as delayed layout in the page.

          1 Reply Last reply
          0

          1/4

          22 Jan 2011, 14:46

          • Login

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