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. Integrating native functionality with QT Webkit ?
Forum Updated to NodeBB v4.3 + New Features

Integrating native functionality with QT Webkit ?

Scheduled Pinned Locked Moved Qt WebKit
2 Posts 2 Posters 865 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.
  • R Offline
    R Offline
    RahulRaj
    wrote on last edited by
    #1

    Does QT webkit allows to have a hybrid model in which the web content can interact with natve cpp code ?

    In short, does it follow 'Phone gap' like model, or is it just a web content render-er alone ?

    1 Reply Last reply
    0
    • S Offline
      S Offline
      ShiraNai7
      wrote on last edited by
      #2

      It does.

      See:

      • http://qt-project.org/doc/qt-5.1/qtwebkit/qtwebkit-bridge.html
      • http://qt-project.org/doc/qt-5.1/qtwebkit/qwebframe.html#

      I did it this way:

      • create a subclass QObject
      • expose your properties/methods by using Q_PROPERTY / Q_INVOKABLE
      • make an instance of your class available by calling addToJavaScriptWindowObject(name, pointer_to_your_object) on a QWebFrame instance.
      • and if you want your object to be available all the times (e.g. after page reload), call addToJavaScriptWindowObject every time the QWebFrame::javaScriptWindowObjectCleared signal is emitted.

      I hope this helped.

      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