Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QtWebEngine
  4. In a Qt Quick Application project, how do I use the "QWebEnginePage::createWindow(QWebEnginePage::WebBrowserWindow)" method to create the full window of a web browser?
QtWS25 Last Chance

In a Qt Quick Application project, how do I use the "QWebEnginePage::createWindow(QWebEnginePage::WebBrowserWindow)" method to create the full window of a web browser?

Scheduled Pinned Locked Moved Unsolved QtWebEngine
qmlqt c++qwebenginepageqapplication
2 Posts 2 Posters 534 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.
  • G Offline
    G Offline
    gouneken
    wrote on 26 Mar 2022, 22:44 last edited by gouneken
    #1

    Good evening to the whole community, I have been working for some time on a search engine project, for ios and Android. For this I created on Qt Creator a Qt Quick Application project, because of the ease of creating graphical interfaces for mobile in the QML language. And for my project, I also used c++ modules of Qt. So I was entitled to a file 'main.cpp' which called a file 'main.qml' for the generation of the window.
    However, the problem is only to create the graphical interface of the software; I used the protected method QWebEnginePage::createWindow(QWebEnginePage::WebBrowserWindow) in one of my class files; but when I compile, I get the basic GUI of main.qml and an error message:
    ee6e428e-5d60-4b80-89f8-22e72c57494b-image.png
    However, I did implement "QApplication" in my project and no errors were generated. Here are some screenshots of my class files
    281dbae4-4754-4ccb-840e-21a9734bdaa5-image.png
    ad34c3fe-d92f-412a-a18c-f13aae28f7d4-image.png
    from my main.cpp file
    3225f82f-aa06-4026-a7c4-f07dc74eaea5-image.png
    and my main.qml file.
    48273579-e22a-41ae-b3ca-984f59adea15-image.png
    I look forward to your answers, thank you!

    1 Reply Last reply
    0
    • G gouneken
      26 Mar 2022, 22:52

      [Thread locked. Duplicate of https://forum.qt.io/topic/135318/ --JKSH]

      Good evening to the whole community, I have been working for some time on a search engine project, for ios and Android. For this I created on Qt Creator a Qt Quick Application project, because of the ease of creating graphical interfaces for mobile in the QML language. And for my project, I also used c++ modules of Qt. So I was entitled to a file 'main.cpp' which called a file 'main.qml' for the generation of the window.
      However, the problem is only to create the graphical interface of the software; I used the protected method QWebEnginePage::createWindow(QWebEnginePage::WebBrowserWindow) in one of my class files; but when I compile, I get the basic GUI of main.qml and an error message:
      ee6e428e-5d60-4b80-89f8-22e72c57494b-image.png

      However, I did implement "QApplication" in my project and no errors were generated. Here are some screenshots of my class files
      281dbae4-4754-4ccb-840e-21a9734bdaa5-image.png
      ad34c3fe-d92f-412a-a18c-f13aae28f7d4-image.png
      from my main.cpp file
      3225f82f-aa06-4026-a7c4-f07dc74eaea5-image.png
      and my main.qml file.
      48273579-e22a-41ae-b3ca-984f59adea15-image.png
      I look forward to your answers, thank you!

      R Offline
      R Offline
      raven-worx
      Moderators
      wrote on 27 Mar 2022, 09:15 last edited by raven-worx
      #2

      @gouneken

      1. multiple inheritance of QObject isn't possible (Page_all class)
      2. your Page_all class inherits QWebEnginePage and also has a QWebEnginePage as a member variable?!
      3. dont name variables the same as their type names!

      the createWindow() method is intended to create a new physical window (a QWidget for example) and return the containing QWebEnginePage. You might need to create another QWebEngineView inside (or a use it directly as a window)

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      1

      1/2

      26 Mar 2022, 22:44

      • Login

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