import sys
from PySide6.QtWidgets import QApplication, QWidget, QVBoxLayout, QMainWindow, QLabel, QPushButton
from PySide6 import QtCore
from PySide6.QtWebEngineWidgets import QWebEngineView



class webView(QWidget):
    def __init__(self):
        super(webView, self).__init__()

        self.layout = QVBoxLayout(self)

        self.webV = QWebEngineView()
        self.fileDir = QtCore.QFileInfo("./docs.html").absoluteFilePath()
        print(self.fileDir)
        # self.webV.load(QtCore.QUrl("file:///" + self.fileDir))
        self.webV.load(QtCore.QUrl("http://127.0.0.1:8080/"))

        self.layout.addWidget(self.webV)


if __name__ == "__main__":
    app = QApplication([])

    web = webView()
    web.show()

    sys.exit(app.exec())

Logo

一站式 AI 云服务平台

更多推荐