ActiveQt interacts with js to realize graphic explanation
小云云
Release: 2018-03-02 13:33:12
Original
2942 people have browsed it
This article mainly uses pictures and texts to share with you examples of interaction between ActiveQt and js. I hope it can help everyone.
1. Develop ActiveX creation project with vs2015+Qt 5.7
1.1. Select "Project" in "New"
1.2. Select Qt ActiveQt Server in Qt and fill in the project name, etc. The interface is as follows:
1.3. Then click Next until completion. The interface definition provided to the outside world is as shown below:
2 , vs2015 debugging ActiveX control environment configuration
2.1. Click the debug button drop-down and select "Attach process to"
2.2. Click the "Debug" button and select "Attach process to" from the drop-down menu to enter the following interface:
2.3. Find the iexplore.exe process , select the IE browser process with an empty "Title", click the "Attach" button, and you can debug at this time. The interface is as follows:
3. Interaction between ActiveQt and js callbacks
##3.1. Method 1: js directly rewrites Qt’s signal function
3.1.1. Qt Define signal method
voideventCallBack(intnType, QStringstrEventName);
##3.1.2, js rewrite method
First, define the OBJECT tag of the control and specify the id. Assuming that the id is ActiveQtServerCallBack, the js method is defined as follows:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn