Форум сайта python.su
from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets app = QtWidgets.QApplication([]) win = QtWidgets.QMainWindow() widget = QtWidgets.QWidget() layout = QtWidgets.QVBoxLayout() layout.setAlignment(QtCore.Qt.AlignmentFlag.AlignTop) w1 = QtWidgets.QLabel("header") # -- w_main = QtWidgets.QTextEdit() # -- w2 = QtWidgets.QLabel("footer") layout.addWidget(w1) layout.addWidget(w_main) layout.addWidget(w2) widget.setLayout(layout) win.setCentralWidget(widget) win.resize(300, 700) win.show() app.exec_()
w_main = QtWidgets.QTextEdit()
w_main = QtWebEngineWidgets.QWebEngineView() w_main.setHtml("test")
Офлайн
w_main = QtWebEngineWidgets.QWebEngineView() w_main.setSizePolicy( QtWidgets.QSizePolicy.Policy.Expanding, QtWidgets.QSizePolicy.Policy.Expanding ) w_main.setHtml("test")
Офлайн