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. Using Qt WebKit
Forum Updated to NodeBB v4.3 + New Features

Using Qt WebKit

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

    Hello all,

    I want to create a C++ app with a HTML page attached to it. I was succesfull in creating the project and add a HTML page and was able to run it. I can now see my HTML page with buttons and text in it.

    Now i want to be able to recieve the HTML button click events in the C++ code. How can i do that?

    Once i recieve the button click, i want to call a JavaScript function in HTML page. How to do that?

    I am new to Qt and WebKit. So please help. I looked at the FormExtractor example in Qt web, but that doesn't talk about how to recive HTML button click events in C++ code.

    Thanks in advance.

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

      Hello. Take a look at this:
      http://qt-project.org/forums/viewthread/35089/#151811

      Then you could do:

      @<button onclick="my_object.buttonPressed()">The button</button>@

      And for running javascript from C++ side, see:

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

      1 Reply Last reply
      0
      • D Offline
        D Offline
        donguy76
        wrote on last edited by
        #3

        Hey

        Is it possible to call C++ functions from JavaScript functions?

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

          Yes. See my first post.

          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