wip
This commit is contained in:
@@ -16,6 +16,18 @@
|
|||||||
|
|
||||||
#include <QWebEngineView>
|
#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[]) {
|
int main(int argc, char *argv[]) {
|
||||||
setenv("XDG_RUNTIME_DIR", "/var/tmp/weston", 1);
|
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
|
// Set a timer to change the background color and load the URL after 0.5 seconds
|
||||||
QTimer::singleShot(2000, [&]() {
|
QTimer::singleShot(2000, [&]() {
|
||||||
QWebEngineView *web_view = new QWebEngineView();
|
WebViewFrame *webViewFrame = new WebViewFrame(this);
|
||||||
window.setStyleSheet(""); // Remove the blue background
|
layout->addWidget(webViewFrame);
|
||||||
web_view->load(QUrl(args.first())); // Load the URL
|
// QWebEngineView *web_view = new QWebEngineView();
|
||||||
layout->addWidget(web_view); // Add the web view to the layout
|
// 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.update(); // Refresh window to apply changes
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user