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

QWebpage createPlugin problem

Scheduled Pinned Locked Moved Qt WebKit
2 Posts 1 Posters 1.7k 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.
  • Q Offline
    Q Offline
    Qtfan
    wrote on last edited by
    #1

    I am embedding widgets in webpages and I have a problem. I hope anyone of you can give me an idea on how to solve it.

    The first page contains three <object> tags:
    @
    <object type="application/x-qt-plugin" classid="TabWidget" name="TabWidget" id="TabWidget"></object>
    <object type="application/x-qt-plugin" classid="ColorPicker" name="colorPicker" id="ColorPicker"></object>
    <object type="application/x-qt-plugin" classid="BaseColorsCircles" name="baseColorsCircles" id="BaseColorsCircles"></object>
    @

    Which causes the following function to be called three times:
    @QObject* customWebPage::createPlugin(
    const QString &classid,
    const QUrl &url,
    const QStringList &paramNames,
    const QStringList &paramValues)
    {
    if (classid=="ColorPicker"){
    return colorPicker;
    } else if(classid=="BaseColorsCircles"){
    return baseColorsCircles;
    } else if(classid=="TabWidget") {
    return tabs;
    } else if(classid=="ColorBlender") {
    return blender;
    } else
    return 0;
    }
    @
    Everything works fine, I even have several slots and signals connected among them and it works. The problem is when I reload the page by any means (Refresh or going to another page and returning). The function is called again and when trying to return any of the elements that were already embedded, it crashes with an error 0xC0000005 and the debugger gives me a warning that says "The inferior stopped because it received a signal from the operating system. Signal name: SIGSEGV Signal meaning: Segmentation fault."

    Any ideas? I have even tried deleting the pointers and reinitializing them before returning them again, but then, the "delete" instructions cause the error.
    Thank you.

    1 Reply Last reply
    0
    • Q Offline
      Q Offline
      Qtfan
      wrote on last edited by
      #2

      Nevermind. Every time the browser is redirected all the embedded objects are deleted so, new objects have to be created for each page.

      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