本文整理汇总了Python中PyQt5.QtWebEngineWidgets.QWebEngineView.resize方法的典型用法代码示例。如果您正苦于以下问题:Python QWebEngineView.resize方法的具体用法?Python QWebEngineView.resize怎么用?Python QWebEngineView.resize使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWebEngineWidgets.QWebEngineView
的用法示例。
在下文中一共展示了QWebEngineView.resize方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: QApplication
# 需要导入模块: from PyQt5.QtWebEngineWidgets import QWebEngineView [as 别名]
# 或者: from PyQt5.QtWebEngineWidgets.QWebEngineView import resize [as 别名]
from PyQt5.QtOpenGL import QGLWidget
import plots
html = '''<html>
<head>
<title>Plotly Example</title>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
%(plot_content)s
</body>
</html>'''
if __name__ == '__main__':
app = QApplication(sys.argv)
w = QWebView()
w.resize(800, 600)
w.setWindowTitle('Simple Plot')
# QWebSettings.globalSettings().setAttribute(QWebSettings.AcceleratedCompositingEnabled, True)
# QWebSettings.globalSettings().setAttribute(QWebSettings.WebGLEnabled, True)
plot_content = plots.plot3d()
w.setHtml(html%{'plot_content':plot_content})
w.show()
sys.exit(app.exec_())
示例2: QApplication
# 需要导入模块: from PyQt5.QtWebEngineWidgets import QWebEngineView [as 别名]
# 或者: from PyQt5.QtWebEngineWidgets.QWebEngineView import resize [as 别名]
from PyQt5.QtWidgets import QApplication, QWidget
#from PyQt5.QtWebEngineWi import QWebView
from PyQt5.QtWebEngineWidgets import QWebEngineView as QWebView
from PyQt5.QtCore import QUrl
import plots
html = '''<html>
<head>
<title>Plotly Example</title>
<script src="https://cdn.plot.ly/plotly-latest.min.js"></script>
</head>
<body>
%(plot_content)s
</body>
</html>'''
if __name__ == '__main__':
app = QApplication(sys.argv)
w = QWebView()
w.resize(900, 700)
w.move(300, 300)
w.setWindowTitle('Simple 2D Plot')
plot_content = plots.plot2d()
w.setHtml(html%{'plot_content':plot_content})
w.show()
sys.exit(app.exec_())