Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [SOLVED] how to invoke Qt method in web page
QtWS25 Last Chance

[SOLVED] how to invoke Qt method in web page

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 2.4k 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.
  • L Offline
    L Offline
    Landy
    wrote on last edited by
    #1

    Hi guys,

    i embeded a Microsoft Web Browser into my App via QAxWidget.
    Now, i wanna invoke a method named test() which is defined in QAxWidget from web page.
    but i have no idea about this.
    any guys can help me?
    thx.

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tucnak
      wrote on last edited by
      #2

      Why do you not use MWB? There are good QtWebkit module which allow to create Qt-widget with Webkit browser.

      1 Reply Last reply
      0
      • L Offline
        L Offline
        Landy
        wrote on last edited by
        #3

        QtWebkit is not supported in static Qt.
        I have to use MWB.

        Now, i found some way to implement calling Qt function in web page, but it's not good.
        so, i wanna register a Qt object into web page, then i can call "window.external.object" in javascript to call Qt function. to implement something just like addToJavaScriptWindowObject in QWebPage.
        [quote author="tucnak" date="1340099970"]Why do you not use MWB? There are good QtWebkit module which allow to create Qt-widget with Webkit browser.[/quote]

        1 Reply Last reply
        0
        • L Offline
          L Offline
          Landy
          wrote on last edited by
          #4

          at last, i found a urgly way to solve this problem, via signal beforenavigate().
          in web page, call window.navigate() with a special string, something like window.navigate("specialstring: xxxx").
          then, signal beforenavigate will be emited. now, we can block the navigation, and process our own work.

          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