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

Larry Martell larry.martell at gmail.com
Thu Mar 17 13:11:28 CET 2016


On Thu, Mar 17, 2016 at 6:41 AM, Konstantin Tokarev <annulen at yandex.ru> wrote:
>
>
> 17.03.2016, 07:13, "Larry Martell" <larry.martell at gmail.com>:
>> 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);
>
> It should be
>
>     ui->webView->setUrl(url);

OK, I'll try that. I thought setUrl did a show and I only wanted to
set the url and not show it at that point.

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