From 64171083869b517e769914e17b35437ec5587e3e Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 May 2024 02:58:43 -0500 Subject: [PATCH] wip --- system/clearpilot/tools/qt_webview.cc | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/system/clearpilot/tools/qt_webview.cc b/system/clearpilot/tools/qt_webview.cc index d5ec189..046a19a 100644 --- a/system/clearpilot/tools/qt_webview.cc +++ b/system/clearpilot/tools/qt_webview.cc @@ -20,10 +20,10 @@ class WebViewFrame : public QFrame { Q_OBJECT public: explicit WebViewFrame(QWidget *parent = nullptr) : QFrame(parent) { - // QVBoxLayout *layout = new QVBoxLayout(this); - // QWebEngineView *web_view = new QWebEngineView(); - // web_view->load(QUrl("http://example.com")); // Change URL as needed - // layout->addWidget(web_view); + QVBoxLayout *layout = new QVBoxLayout(this); + QWebEngineView *web_view = new QWebEngineView(); + web_view->load(QUrl("http://example.com")); // Change URL as needed + layout->addWidget(web_view); } }; @@ -36,11 +36,14 @@ public: this->setStyleSheet("background-color: black;"); this->showFullScreen(); - WebViewFrame *webViewFrame = new WebViewFrame(this); QVBoxLayout *mainLayout = new QVBoxLayout(this); - mainLayout->addWidget(webViewFrame); this->setLayout(mainLayout); this->show(); + + QTimer::singleShot(2000, [&]() { + WebViewFrame *webViewFrame = new WebViewFrame(this); + mainLayout->addWidget(webViewFrame); + }); } };