Monday, March 19, 2012

IE in Qt with ActiveQt

I am a beginner to Qt, learning about qt and the features it provides. I was going through an example of Qt which shows how to use ActiveX controls inside Qt using ActiveQt, this example shows how to use WebBrowser control in Qt. Example application is very good but I wanted some additional functionality in this browser and its to block internet explorer to get launched when new popup window is created. What happening was when I click on a link which opens a popup window instead of opening my window an internet explorer was getting launched.. Well this is not what I want, I want it to open my window. To make this work I went through docs of WebBrowser control at http://msdn.microsoft.com/en-us/library/aa752127(v=vs.85).aspx and tried to connect NewWindow, NewWindow2, NewWindow3 slots to block popup but after connecting all the slots and doing everything I found nothing was working...
So finally I decided to go through all the functions of WebBrowser object i.e. WebAxWidget. There I found this method generateDocumentation which docs says -
Returns a rich text string with documentation for the wrapped COM object. Dump the string to an HTML-file, or use it in e.g. a QTextBrowser widget.
So, using this method I generated docs for WebBrowser control and found that the slots which I was connecting had totally different signature than the actual one's!!
This generateDocumentation is a REQUIRED method if you are using any activex controls inside your qt app, coz you the slots you think are correct may not exists!!
generateDocumentation  is a method of QAxBase class which provides API to initializes and access COM objects.

No comments:

Post a Comment

Ads Inside Post