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 response html5 events from qt5
Forum Updated to NodeBB v4.3 + New Features

How to response html5 events from qt5

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

    I have a html5 application with buttons.
    i want to response to clicked events (for example...) by qt5.
    how i do it?
    may be by webKit? how i do it?

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      Welcome to devnet,

      You can with QWebview.

      1. Load the HTML page using "QWebview":http://qt-project.org/doc/qt-5/qwebview.html
      2. Make a C++ class derived from QObject which is available to the page using "addToJavaScriptWindowObject":http://qt-project.org/doc/qt-5/qwebframe.html#addToJavaScriptWindowObject. Add a Q_INVOKABLE function to this class.
      3. In HTML page you can create a JavaScript function which will be able to call the function in C++ class by using the exposed object's name.
      4. Call this JavaScript function on button click.

      157

      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