Qt World Summit: Submit your Presentation

[Solved] QWebKit: Difference between a link-clicked vs meta-refresh at loadStarted() signal

  • 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.


  • What about subclassing QWebPage and using acceptNavigationRequest()? I think the NavigationType should give you enough information.

  • Brilliant! I hadn't picked up on that protected function. I'll check it out. Thanks.

  • Fixed my problem. Thanks for the pointer.

  • [quote author="bmahf" date="1286984397"]Fixed my problem. Thanks for the pointer.[/quote]

    Great. I am glad it helps.

Log in to reply