[Interest] bug with # in URL when using setUrl?

Larry Martell larry.martell at gmail.com
Thu Mar 17 05:12:22 CET 2016


On Wed, Mar 16, 2016 at 12:04 PM, Konstantin Tokarev <annulen at yandex.ru> wrote:
>
>
> 16.03.2016, 18:39, "Larry Martell" <larry.martell at gmail.com>:
>>  On Wed, Mar 16, 2016 at 6:29 AM, Konstantin Tokarev <annulen at yandex.ru> wrote:
>>>   16.03.2016, 02:15, "Larry Martell" <larry.martell at gmail.com>:
>>>>   -How can I debug the Angular code?
>>>
>>>   QtWebKit has developer tools. You need to create QWebInspector, set QWebPage to it,
>>>   and enable QWebSettings::DeveloperExtrasEnabled
>>>
>>>   You will get error console, JS debugger, and other goodies.
>>
>>  This sounds very promising but I can't quite figure out how to use it.
>>
>>  I have this JS code that's somehow downloaded (I assume by nginx). How
>>  do I integrate QWebInspector and QWebPage into the Qt app so they can
>>  access that code?
>
> In the beginning you've mentioned that you have QWebView. That's enough, you can get QWebPage using page() method, you can create QWebInspector as a separate widget (see code example in docs), call its setPage() method and show it somewhere

Thanks. This is what I was doing before:

ui->webView->setUrl(url);

And I commented that out and I have this now:

  Dialog = new QDialog(this);
  ui->webView->setPage(url);
  QWebPage *page = ui->webView->page();
  QWebInspector *inspector = new QWebInspector(Dialog);
  inspector->setPage(page);
  Dialog->show();

Problem is that url is a QUrl and setPage wants a QWebPage *

(If you couldn't tell I am brand new to Qt.)



More information about the Interest mailing list