PDA

View Full Version : QWebKit: Difference between a link-clicked vs meta-refresh at loadStarted() signal



bmahf
12th October 2010, 17:56
Hi all,

I am modifying software for my company, written around QWebKit, and have a very specific question about the use of the QWebPage::loadStarted() signal. I can see 2 ways I could get that signal sent to me: Link clicked or meta-refresh (using the tag <meta http-equiv="refresh" content="5"> in the head area). The problem I am having is I need to know the difference, but am connecting to a signal that has no parameters. Can anyone tell me how I can find out whether the signal was received as a result of a clicked link versus a meta refresh? This is pretty important. I need to react differently (if ever so slightly) in each case.

Thanks...

bmahf
13th October 2010, 16:45
Turns out that I just needed to subclass from QWebPage and override the virtual function acceptNavigationRequest() which passes in a QWebPage::NavigationType as one of the parameters.