This commit is contained in:
Your Name
2024-05-10 02:47:09 -05:00
parent b2a5c33763
commit 06181f6cc2

View File

@@ -16,6 +16,18 @@
#include <QWebEngineView>
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);
}
};
int main(int argc, char *argv[]) {
setenv("XDG_RUNTIME_DIR", "/var/tmp/weston", 1);
@@ -78,10 +90,11 @@ int main(int argc, char *argv[]) {
// Set a timer to change the background color and load the URL after 0.5 seconds
QTimer::singleShot(2000, [&]() {
QWebEngineView *web_view = new QWebEngineView();
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
WebViewFrame *webViewFrame = new WebViewFrame(this);
layout->addWidget(webViewFrame);
// QWebEngineView *web_view = new QWebEngineView();
// 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
});