CreateWindow override
-
wrote on 10 Sept 2010, 18:28 last edited by
If I'm using a Qt Creator project & UI file, how do I have use a custom QWebView in order to override CreateWindow? Or how do I dynamically make it use my Createwindow method?
-
wrote on 10 Sept 2010, 18:51 last edited by
Sorry, I do not understand what you want to do.
Can't you just pull a QWebView into the UI and be done?
-
wrote on 10 Sept 2010, 18:55 last edited by
I'm using Qt Creator and I drag a WebView onto my form. But in order for this web view to open new windows, I need to override the createWindow method of either the QWebView or the QWebPage. But the WebView is created via the .ui file. I'm thinking I need to create my own QWebPage class and then call the QWebView->setPage method.
-
wrote on 10 Sept 2010, 20:35 last edited by
You can do any of those, subclass the view or the page (for many use of WebKit, you'll want a subclass of QWebPage anyway).
If you subclass QWebView, you can still use QtCreator and designer. You just need to promote the widget to your subclass (see the doc of Qt Designer).
-
wrote on 10 Sept 2010, 20:41 last edited by
As I've been finding out, subclassing the WebPage is the way to go and, like you say, it looks necessary. Thx.
5/5