wip
This commit is contained in:
@@ -1,50 +1,66 @@
|
|||||||
#include <sys/resource.h>
|
#include <sys/resource.h>
|
||||||
|
|
||||||
#include <QApplication>
|
// #include <QApplication>
|
||||||
#include <QTranslator>
|
// #include <QTranslator>
|
||||||
|
|
||||||
#include "/data/openpilot/system/hardware/hw.h"
|
#include "/data/openpilot/system/hardware/hw.h"
|
||||||
#include "/data/openpilot/selfdrive/ui/qt/qt_window.h"
|
#include "/data/openpilot/selfdrive/ui/qt/qt_window.h"
|
||||||
#include "/data/openpilot/selfdrive/ui/qt/util.h"
|
#include "/data/openpilot/selfdrive/ui/qt/util.h"
|
||||||
|
|
||||||
#include <QCommandLineParser>
|
// #include <QCommandLineParser>
|
||||||
#include <QApplication>
|
// #include <QApplication>
|
||||||
#include <QWidget>
|
// #include <QWidget>
|
||||||
#include <QTextEdit>
|
// #include <QTextEdit>
|
||||||
#include <QLabel>
|
// #include <QLabel>
|
||||||
#include <QProcess>
|
// #include <QProcess>
|
||||||
#include <QVBoxLayout>
|
// #include <QVBoxLayout>
|
||||||
#include <QFont>
|
// #include <QFont>
|
||||||
#include <QScreen>
|
// #include <QScreen>
|
||||||
#include <QScrollBar>
|
// #include <QScrollBar>
|
||||||
#include <QGuiApplication>
|
// #include <QGuiApplication>
|
||||||
#include <QWebEngineView>
|
// #include <QWebEngineView>
|
||||||
#include <QStackedLayout>
|
// #include <QStackedLayout>
|
||||||
|
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
|
#include <QFrame>
|
||||||
|
#include <QVBoxLayout>
|
||||||
|
#include <QWebEngineView>
|
||||||
|
#include <QWidget>
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
class MainWindow : public QWidget {
|
||||||
|
Q_OBJECT
|
||||||
|
public:
|
||||||
|
explicit MainWindow(QWidget *parent = nullptr) {
|
||||||
|
this->setWindowTitle("Webview in Frame");
|
||||||
|
this->setStyleSheet("background-color: black;");
|
||||||
|
|
||||||
|
WebViewFrame *webViewFrame = new WebViewFrame(this);
|
||||||
|
QVBoxLayout *mainLayout = new QVBoxLayout(this);
|
||||||
|
mainLayout->addWidget(webViewFrame);
|
||||||
|
this->setLayout(mainLayout);
|
||||||
|
this->show();
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
int main(int argc, char *argv[]) {
|
int main(int argc, char *argv[]) {
|
||||||
setpriority(PRIO_PROCESS, 0, -20);
|
setpriority(PRIO_PROCESS, 0, -20);
|
||||||
|
initApp(argc, argv);
|
||||||
initApp(argc, argv);
|
QApplication app(argc, argv);
|
||||||
|
MainWindow mainWindow;
|
||||||
QApplication a(argc, argv);
|
setMainWindow(&mainWindow);
|
||||||
|
return app.exec();
|
||||||
QWidget window;
|
|
||||||
window.setWindowTitle("Webview");
|
|
||||||
window.setStyleSheet("background-color: black;");
|
|
||||||
|
|
||||||
QVBoxLayout *layout = new QVBoxLayout(&window);
|
|
||||||
// layout->setSpacing(0);
|
|
||||||
// layout->setContentsMargins(0, 0, 0, 0);
|
|
||||||
|
|
||||||
// QString url = args.first();
|
|
||||||
QWebEngineView *web_view = new QWebEngineView();
|
|
||||||
web_view->load(QUrl(argv[1]));
|
|
||||||
layout->addWidget(web_view);
|
|
||||||
|
|
||||||
// window.showFullScreen();
|
|
||||||
window.show();
|
|
||||||
|
|
||||||
// a.installEventFilter(&w);
|
|
||||||
return a.exec();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// #include "main.moc"
|
||||||
|
|||||||
Reference in New Issue
Block a user