wip
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
#include "selfdrive/ui/qt/maps/map_settings.h"
|
||||
#endif
|
||||
|
||||
#include <pybind11/embed.h> // pybind11 header to control Python embedding
|
||||
namespace py = pybind11;
|
||||
|
||||
// HomeWindow: the container for the offroad and onroad UIs
|
||||
|
||||
HomeWindow::HomeWindow(QWidget* parent) : QWidget(parent) {
|
||||
@@ -190,6 +193,13 @@ OffroadHome::OffroadHome(QWidget* parent) : QFrame(parent) {
|
||||
home_layout->setSpacing(30);
|
||||
|
||||
// Clearpilot: removed home ui widgets
|
||||
py::scoped_interpreter guard{}; // Start the Python interpreter
|
||||
auto python_module = py::module_::import("/data/openpilot/webviewtest.py");
|
||||
auto WebViewWidget = python_module.attr("WebViewWidget");
|
||||
|
||||
auto python_widget_instance = WebViewWidget();
|
||||
auto* python_widget_embedded = python_widget_instance.cast<QWidget*>();
|
||||
home_layout->addWidget(python_widget_embedded);
|
||||
}
|
||||
center_layout->addWidget(home_widget);
|
||||
|
||||
|
||||
11
webviewtest.py
Normal file
11
webviewtest.py
Normal file
@@ -0,0 +1,11 @@
|
||||
from PyQt5.QtWidgets import QApplication, QWidget
|
||||
from PyQt5.QtWebEngineWidgets import QWebEngineView
|
||||
|
||||
class WebViewWidget(QWidget):
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
self.browser = QWebEngineView()
|
||||
self.browser.setUrl("http://www.example.com")
|
||||
layout = QVBoxLayout()
|
||||
layout.addWidget(self.browser)
|
||||
self.setLayout(layout)
|
||||
Reference in New Issue
Block a user