Unsolved Open New Window signal in ActiveQt
-
Hi,
How can i get the signal to open the link in new tab.
I am using QTabWidget and i do not want to open it in IE browser. I want to catch the signal in ActiveQt and open the new tab in QTabWidget.Can you please give me signal handler in ActiveQt (QAxWidget) ?
Thanks in Advance.
-
@Neel-Patel said in Open New Window signal in ActiveQt:
Hi
Its a bit unclear what you try
there is this example
http://doc.qt.io/qt-5/activeqt-activeqt-webbrowser-example.htmlI think it will fire
void on_WebBrowser_BeforeNavigate();
when you click on a link. -
@mrjj said in Open New Window signal in ActiveQt:
on_WebBrowser_BeforeNavigate
There is no callback fired. I took the reference for this example only. When we set any URL on link and open that link then currently it is opening by default in IE browser. But i want to handle it my own rather than opening in IE browser. How to do that ?
-
@Neel-Patel said in Open New Window signal in ActiveQt:
I took the reference for this example only.
Im not sure what you mean.
Did you connect to your own slot and checked ?
-
Hi mrjj,
Yes , i have checked with own slot and it is working fine.
Let me explain with "webbrowser" example which is available in Qt source code in ActiveQt.
Currently - when we compile and run "webbrowser" example, by default it opens "qt.io" website in QAxWidget. Now go to textedit and change the URL to "www.news.google.com" and then go. So it will display news website data. Now click on any link - it open the new IE instance.
Here, there is no code to open in new IE browser. How can i catch this signal in webbrowser sample application so that i can open in new tab of QTabWidget instead of new IE instance.
Let me know if you still need explanation.
-
@Neel-Patel said in Open New Window signal in ActiveQt:
Ahh. I see. Sadly that is handled by the Internet Explorer ActiveX so I think you will have to dig into that api to find out if possible.
https://msdn.microsoft.com/en-us/library/aa752127(v=vs.85).aspx
It seems that it does forward the signals ( when clicking a link) but you cannot stop it from happening . ( or i do not see how)
update:
it does seem possible
https://www.experts-exchange.com/questions/21265909/IWebBrowser2-best-way-to-intercept-navigation-and-modify-the-HTTP-headers.html -
Hi mrjj,
Thank you for the update.
I have tried with different "IWebBrowserEvent2" interfaces but not able to find how to receive that events with Qt's COM interface.
I have tried with installing event filter with "QAxWidget" but not getting any "IWebBrowserEvent2" interfaces event.Can you point some examples or pointers so that i can implement and suggest some solution.
Thanks in Advance.