link do folderu z python: ===>>>>>>>
=====>>>>>>Python3 ide for win 10
test on fujtsu core i5 vpro easy install usage
qt webview exemple => sourceimport sysfrom PySide6.QtCore import QUrlfrom PySide6.QtGui import QIconfrom PySide6.QtWidgets import (QApplication, QLineEdit,QMainWindow, QPushButton, QToolBar)from PySide6.QtWebEngineCore import QWebEnginePagefrom PySide6.QtWebEngineWidgets import QWebEngineViewclass MainWindow(QMainWindow):def __init__(self):super().__init__()self.setWindowTitle('PySide6 WebEngineWidgets Example')self.toolBar = QToolBar()self.addToolBar(self.toolBar)self.backButton = QPushButton()self.backButton.setIcon(QIcon(':/qt-project.org/styles/commonstyle/images/left-32.png'))self.backButton.clicked.connect(self.back)self.toolBar.addWidget(self.backButton)self.forwardButton = QPushButton()self.forwardButton.setIcon(QIcon(':/qt-project.org/styles/commonstyle/images/right-32.png'))self.forwardButton.clicked.connect(self.forward)self.toolBar.addWidget(self.forwardButton)self.addressLineEdit = QLineEdit()self.addressLineEdit.returnPressed.connect(self.load)self.toolBar.addWidget(self.addressLineEdit)self.webEngineView = QWebEngineView()self.setCentralWidget(self.webEngineView)initialUrl = 'http://qt.io'self.addressLineEdit.setText(initialUrl)self.webEngineView.load(QUrl(initialUrl))self.webEngineView.page().titleChanged.connect(self.setWindowTitle)self.webEngineView.page().urlChanged.connect(self.urlChanged)def load(self):url = QUrl.fromUserInput(self.addressLineEdit.text())if url.isValid():self.webEngineView.load(url)def back(self):self.webEngineView.page().triggerAction(QWebEnginePage.Back)def forward(self):self.webEngineView.page().triggerAction(QWebEnginePage.Forward)def urlChanged(self, url):self.addressLineEdit.setText(url.toString())if __name__ == '__main__':app = QApplication(sys.argv)mainWin = MainWindow()availableGeometry = mainWin.screen().availableGeometry()mainWin.resize(availableGeometry.width() * 2 / 3, availableGeometry.height() * 2 / 3)mainWin.show()sys.exit(app.exec())
output
No comments:
Post a Comment