wip
This commit is contained in:
@@ -28,6 +28,22 @@ public:
|
||||
};
|
||||
|
||||
|
||||
class MainWindow : public QWidget {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit MainWindow(QWidget *parent = nullptr) {
|
||||
this->setWindowTitle("Webview in Frame");
|
||||
this->setStyleSheet("background-color: black;");
|
||||
window.showFullScreen();
|
||||
|
||||
WebViewFrame *webViewFrame = new WebViewFrame(this);
|
||||
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
||||
mainLayout->addWidget(webViewFrame);
|
||||
this->setLayout(mainLayout);
|
||||
this->show();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
int main(int argc, char *argv[]) {
|
||||
setenv("XDG_RUNTIME_DIR", "/var/tmp/weston", 1);
|
||||
@@ -49,10 +65,7 @@ int main(int argc, char *argv[]) {
|
||||
}
|
||||
|
||||
// Common init
|
||||
QWidget window;
|
||||
window.setWindowTitle("Generic Window");
|
||||
window.setStyleSheet("background-color: blue;");
|
||||
window.showFullScreen();
|
||||
MainWindow window;
|
||||
|
||||
auto windowHandle = window.windowHandle();
|
||||
if (!windowHandle) {
|
||||
@@ -72,31 +85,31 @@ int main(int argc, char *argv[]) {
|
||||
|
||||
window.setFixedSize(2160, 1080);
|
||||
|
||||
QVBoxLayout *layout = new QVBoxLayout(&window);
|
||||
layout->setSpacing(0);
|
||||
layout->setContentsMargins(0, 0, 0, 0);
|
||||
// QVBoxLayout *layout = new QVBoxLayout(&window);
|
||||
// layout->setSpacing(0);
|
||||
// layout->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
QTextEdit *outputDisplay = new QTextEdit;
|
||||
outputDisplay->setFont(QFont("Consolas", 32));
|
||||
outputDisplay->setReadOnly(true);
|
||||
outputDisplay->setFixedSize(window.width(), window.height());
|
||||
outputDisplay->setStyleSheet("color: white; background-color: black;");
|
||||
outputDisplay->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Hide the vertical scrollbar
|
||||
layout->addWidget(outputDisplay);
|
||||
// QTextEdit *outputDisplay = new QTextEdit;
|
||||
// outputDisplay->setFont(QFont("Consolas", 32));
|
||||
// outputDisplay->setReadOnly(true);
|
||||
// outputDisplay->setFixedSize(window.width(), window.height());
|
||||
// outputDisplay->setStyleSheet("color: white; background-color: black;");
|
||||
// outputDisplay->setVerticalScrollBarPolicy(Qt::ScrollBarAlwaysOff); // Hide the vertical scrollbar
|
||||
// layout->addWidget(outputDisplay);
|
||||
|
||||
// QString url = args.first();
|
||||
// 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(2000, [&]() {
|
||||
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
|
||||
});
|
||||
// QTimer::singleShot(2000, [&]() {
|
||||
// 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
|
||||
// });
|
||||
|
||||
// window.showFullScreen();
|
||||
window.show();
|
||||
|
||||
Reference in New Issue
Block a user