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?
-
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:
However, I did implement "QApplication" in my project and no errors were generated. Here are some screenshots of my class files
from my main.cpp file
and my main.qml file.
I look forward to your answers, thank you! -
- multiple inheritance of QObject isn't possible (Page_all class)
- your Page_all class inherits QWebEnginePage and also has a QWebEnginePage as a member variable?!
- 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)