本文整理汇总了Python中PyQt5.QtCore.Qt.WindowMaximized方法的典型用法代码示例。如果您正苦于以下问题:Python Qt.WindowMaximized方法的具体用法?Python Qt.WindowMaximized怎么用?Python Qt.WindowMaximized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtCore.Qt
的用法示例。
在下文中一共展示了Qt.WindowMaximized方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: mouseMoveEvent
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMaximized [as 别名]
def mouseMoveEvent(self, event):
if self.win.windowState() == Qt.WindowNoState:
self.nheight = self.win.geometry().height()
if event.buttons() == Qt.LeftButton and self.mPos:
if event.pos() == self.mPos:
return
if self.win.windowState() == Qt.WindowMaximized:
MaxWinWidth = self.width() # 窗口最大化宽度
WinX = self.win.geometry().x() # 窗口屏幕左上角x坐标
self.win.showNormal()
self.buttonMaximum.setText('1')
# 还原后的窗口宽和高
nwidth = self.width()
nheight = self.nheight
x, y = event.globalPos().x(), event.globalPos().y()
x = x - nwidth * (x-WinX)/MaxWinWidth
self.win.setGeometry(x, 1, nwidth, nheight)
return
movePos = event.globalPos() - self.mPos
self.mPos = event.globalPos()
self.win.move(self.win.pos() + movePos)
return QWidget().mouseMoveEvent(event)
示例2: openWebUI
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMaximized [as 别名]
def openWebUI(self):
if self.device and self.device.p.get('IPAddress'):
url = QUrl("http://{}".format(self.device.p['IPAddress']))
try:
webui = QWebEngineView()
webui.load(url)
frm_webui = QFrame()
frm_webui.setWindowTitle("WebUI [{}]".format(self.device.p['FriendlyName1']))
frm_webui.setFrameShape(QFrame.StyledPanel)
frm_webui.setLayout(VLayout(0))
frm_webui.layout().addWidget(webui)
frm_webui.destroyed.connect(self.updateMDI)
self.mdi.addSubWindow(frm_webui)
self.mdi.setViewMode(QMdiArea.TabbedView)
frm_webui.setWindowState(Qt.WindowMaximized)
except NameError:
QDesktopServices.openUrl(QUrl("http://{}".format(self.device.p['IPAddress'])))
示例3: _onWindowGeometryChanged
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMaximized [as 别名]
def _onWindowGeometryChanged(self):
# Do not store maximised window geometry, but store state instead
# Using windowState instead of isMaximized is a workaround for QTBUG-30085
if self.windowState() == Qt.WindowNoState:
self._preferences.setValue("general/window_width", self.width())
self._preferences.setValue("general/window_height", self.height())
self._preferences.setValue("general/window_left", self.x())
self._preferences.setValue("general/window_top", self.y())
if self.windowState() in (Qt.WindowNoState, Qt.WindowMaximized):
self._preferences.setValue("general/window_state", self.windowState())
示例4: move
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMaximized [as 别名]
def move(self, pos):
if self.windowState() == Qt.WindowMaximized or self.windowState() == Qt.WindowFullScreen:
# 最大化或者全屏则不允许移动
return
super(FramelessWindow, self).move(pos)
示例5: showMaximized
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMaximized [as 别名]
def showMaximized(self):
"""最大化、还原"""
if self.buttonMaximum.text() == '1':
# 最大化
self.buttonMaximum.setText('2')
self.win.showMaximized()
self.win.setWindowState(Qt.WindowMaximized)
else: #还原
self.buttonMaximum.setText('1')
self.win.showNormal()
# self.win.setWindowState(Qt.WindowNoState)
示例6: add_devices_tab
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMaximized [as 别名]
def add_devices_tab(self):
self.devices_list = ListWidget(self)
sub = self.mdi.addSubWindow(self.devices_list)
sub.setWindowState(Qt.WindowMaximized)
self.devices_list.deviceSelected.connect(self.selectDevice)
self.devices_list.openConsole.connect(self.openConsole)
self.devices_list.openRulesEditor.connect(self.openRulesEditor)
self.devices_list.openTelemetry.connect(self.openTelemetry)
self.devices_list.openWebUI.connect(self.openWebUI)
示例7: openRulesEditor
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMaximized [as 别名]
def openRulesEditor(self):
if self.device:
rules = RulesWidget(self.device)
self.mqtt.messageSignal.connect(rules.parseMessage)
rules.sendCommand.connect(self.mqtt_publish)
self.mdi.setViewMode(QMdiArea.TabbedView)
self.mdi.addSubWindow(rules)
rules.setWindowState(Qt.WindowMaximized)
rules.destroyed.connect(self.updateMDI)
self.mqtt_queue.append((self.device.cmnd_topic("ruletimer"), ""))
self.mqtt_queue.append((self.device.cmnd_topic("rule1"), ""))
self.mqtt_queue.append((self.device.cmnd_topic("Var"), ""))
self.mqtt_queue.append((self.device.cmnd_topic("Mem"), ""))
示例8: updateMDI
# 需要导入模块: from PyQt5.QtCore import Qt [as 别名]
# 或者: from PyQt5.QtCore.Qt import WindowMaximized [as 别名]
def updateMDI(self):
if len(self.mdi.subWindowList()) == 1:
self.mdi.setViewMode(QMdiArea.SubWindowView)
self.devices_list.setWindowState(Qt.WindowMaximized)