From 63c5de263ab499190a5a355d674bdd16af14e56f Mon Sep 17 00:00:00 2001 From: Your Name Date: Fri, 10 May 2024 02:28:08 -0500 Subject: [PATCH] wip --- system/clearpilot/tools/qt_webview.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/system/clearpilot/tools/qt_webview.cc b/system/clearpilot/tools/qt_webview.cc index 4437f4f..58ec754 100644 --- a/system/clearpilot/tools/qt_webview.cc +++ b/system/clearpilot/tools/qt_webview.cc @@ -38,7 +38,7 @@ int main(int argc, char *argv[]) { // Common init QWidget window; window.setWindowTitle("Generic Window"); - window.setStyleSheet("background-color: black;"); + window.setStyleSheet("background-color: blue;"); window.showFullScreen(); auto windowHandle = window.windowHandle(); @@ -65,8 +65,16 @@ int main(int argc, char *argv[]) { // QString url = args.first(); QWebEngineView *web_view = new QWebEngineView(); - web_view->load(QUrl(argv[1])); - layout->addWidget(web_view); + // web_view->load(QUrl(argv[1])); + // layout->addWidget(web_view); + + // Set a timer to change the background color and load the URL after 0.5 seconds + QTimer::singleShot(500, [&]() { + window.setStyleSheet(""); // Remove the blue background + web_view->load(QUrl(args.first())); // Load the URL + layout->addWidget(web_view); // Add the web view to the layout + window.update(); // Refresh window to apply changes + }); // window.showFullScreen(); window.show();