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();