Open luoshuai5 opened 5 years ago
I would also like to know how to make a drop-in replacement for QWebView. Should I import Ultralight as a third-party library and make a custom Qt widget instantiating a View? Or should I extend the QWebView class?
OK, I managed to embed Ultraview as a QWidget in Qt5 app on Windows 10 by using createWindowContainer()
method:
app = App::Create();
window = Window::Create(app->main_monitor(), WINDOW_WIDTH, WINDOW_HEIGHT, false, 0);
app->set_window(*window.get());
overlay = Overlay::Create(*window.get(), 0, 0, 0, 0);
...
unsigned long winId = (unsigned long) window->native_handle();
QWindow* qWindow = QWindow::fromWinId(winId);
QWidget* qWidget = createWindowContainer(qWindow);
setCentralWidget(qWidget);
Here is the screenshot:
I made a brand new repo Qt Ultralight Browser which showcases QUltralight widget in Qt app.
I hope this library can support mixed development, such as MFC, Qt.