feat: added websitewidget

This commit is contained in:
2024-04-23 09:23:17 +02:00
parent 1694215c06
commit de7eaf7826
+13 -8
View File
@@ -3,25 +3,30 @@ from qtpy.QtWebEngineWidgets import QWebEngineView
from qtpy.QtWidgets import QApplication, QVBoxLayout, QWidget
class VSCodeEditor(QWidget):
token = "bec"
host = "localhost"
port = 7000
def __init__(self):
class WebsiteWidget(QWidget):
def __init__(self, url):
super().__init__()
self.editor = QWebEngineView(self)
layout = QVBoxLayout()
layout.addWidget(self.editor)
self.setLayout(layout)
self.editor.setUrl(QUrl(f"http://{self.host}:{self.port}?tkn={self.token}"))
self.editor.setUrl(QUrl(url))
class VSCodeEditor(WebsiteWidget):
token = "bec"
host = "localhost"
port = 7000
def __init__(self):
super().__init__(f"http://{self.host}:{self.port}?tkn={self.token}")
if __name__ == "__main__":
import sys
app = QApplication(sys.argv)
mainWin = VSCodeEditor()
mainWin = WebsiteWidget("https://scilog.psi.ch")
mainWin.show()
sys.exit(app.exec())