Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt WebKit
  4. CreateWindow override
QtWS25 Last Chance

CreateWindow override

Scheduled Pinned Locked Moved Qt WebKit
5 Posts 3 Posters 5.3k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    jdarnold
    wrote on last edited by
    #1

    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?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      tobias.hunger
      wrote on last edited by
      #2

      Sorry, I do not understand what you want to do.

      Can't you just pull a QWebView into the UI and be done?

      1 Reply Last reply
      0
      • J Offline
        J Offline
        jdarnold
        wrote on last edited by
        #3

        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.

        1 Reply Last reply
        0
        • B Offline
          B Offline
          benjamin.poulain
          wrote on last edited by
          #4

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

          1 Reply Last reply
          0
          • J Offline
            J Offline
            jdarnold
            wrote on last edited by
            #5

            As I've been finding out, subclassing the WebPage is the way to go and, like you say, it looks necessary. Thx.

            1 Reply Last reply
            0

            • Login

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved