本文整理汇总了Python中PyQt5.QtWebEngineWidgets.QWebEngineView.showMaximized方法的典型用法代码示例。如果您正苦于以下问题:Python QWebEngineView.showMaximized方法的具体用法?Python QWebEngineView.showMaximized怎么用?Python QWebEngineView.showMaximized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtWebEngineWidgets.QWebEngineView
的用法示例。
在下文中一共展示了QWebEngineView.showMaximized方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: Window
# 需要导入模块: from PyQt5.QtWebEngineWidgets import QWebEngineView [as 别名]
# 或者: from PyQt5.QtWebEngineWidgets.QWebEngineView import showMaximized [as 别名]
class Window(BaseWindow):
def __init__(self):
self.debug=1
self.app = QApplication(sys.argv)
self.desktop= QApplication.desktop()
self.web = QWebEngineView()
self.icon = QIcon(ICON)
#self.web.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
self.web.titleChanged.connect(self.title_changed)
self.web.iconUrlChanged.connect(self.icon_changed)
self.web.page().windowCloseRequested.connect(self.close_window)
self.web.page().geometryChangeRequested.connect(self.set_geometry)
def show(self,window_state):
if window_state == "maximized" and not self.web.isMaximized():
self.web.showNormal()
self.web.showMaximized()
elif window_state == "fullscreen" and not self.web.isFullScreen():
self.web.showNormal()
self.web.showFullScreen()
elif window_state == "normal":
self.web.showNormal()
else:
self.web.show()
def run(self):
return self.app.exec_()
def set_debug(self, debuglevel):
self.debug=debuglevel
def set_geometry(self,geom ):
self.web.setGeometry(geom)
def close_window(self):
sys.exit()
def icon_changed(self):
if not self.icon.isNull():
self.web.setWindowIcon(self.icon)
def title_changed(self, title):
self.web.setWindowTitle(title)
def load_url(self,url):
self.url=QUrl.fromEncoded(url)
self.web.setUrl(self.url)
def set_size(self,width, height):
if width<=0:
width=640
if height<=0:
height=480
left=(self.desktop.width()-width)/2
top=(self.desktop.height()-height)/2
self.web.setGeometry(left,top,width,height)