本文整理汇总了Python中PyQt5.QtGui.QResizeEvent方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QResizeEvent方法的具体用法?Python QtGui.QResizeEvent怎么用?Python QtGui.QResizeEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtGui
的用法示例。
在下文中一共展示了QtGui.QResizeEvent方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: event
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def event(self, e):
if not isinstance(e, (
QtCore.QEvent,
QtCore.QChildEvent,
QtCore.QDynamicPropertyChangeEvent,
QtGui.QPaintEvent,
QtGui.QHoverEvent,
QtGui.QMoveEvent,
QtGui.QEnterEvent,
QtGui.QResizeEvent,
QtGui.QShowEvent,
QtGui.QPlatformSurfaceEvent,
QtGui.QWindowStateChangeEvent,
QtGui.QKeyEvent,
QtGui.QWheelEvent,
QtGui.QMouseEvent,
QtGui.QFocusEvent,
QtGui.QHelpEvent,
QtGui.QHideEvent,
QtGui.QCloseEvent,
QtGui.QInputMethodQueryEvent,
QtGui.QContextMenuEvent,
)):
log().warning("unknown event: %r %r", e.type(), e)
return super().event(e)
示例2: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, a0: QtGui.QResizeEvent) -> None:
super().resizeEvent(a0)
if self.pixmap() is not None:
self.setPixmap(
self.pix.scaled(
self.size(),
QtCore.Qt.KeepAspectRatio,
QtCore.Qt.FastTransformation))
示例3: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, e: QResizeEvent) -> None:
"""Window resize event."""
super().resizeEvent(e)
if self.count() == 2:
self._adjust_size()
示例4: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, event: QtGui.QResizeEvent): # noqa: N802
"""
The view is resized. We need to fit the scene rectangle into the view without distorting the scene proportions.
We also need to center on the center in order to keep the scene centered.
"""
super().resizeEvent(event)
scene_rect = self.sceneRect()
self.fitInView(scene_rect, QtCore.Qt.KeepAspectRatio)
self.centerOn(scene_rect.center())
示例5: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, event: QResizeEvent) -> None:
self.setFixedWidth(210 if self.verticalScrollBar().isVisible() else 190)
self.parent.listheader.setFixedWidth(self.width())
示例6: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, a0: QtGui.QResizeEvent) -> None:
if not self.isPopout:
self.setFixedWidth(a0.size().height())
self.chartWidth = a0.size().height()-40
self.chartHeight = a0.size().height()-40
else:
min_dimension = min(a0.size().height(), a0.size().width())
self.chartWidth = self.chartHeight = min_dimension - 40
self.update()
示例7: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, a0: QtGui.QResizeEvent) -> None:
self.chartWidth = a0.size().width()-self.rightMargin-self.leftMargin
self.chartHeight = a0.size().height() - self.bottomMargin - self.topMargin
self.update()
示例8: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, a0: QtGui.QResizeEvent) -> None:
super().resizeEvent(a0)
self.chartWidth = self.width() - self.leftMargin - self.rightMargin
self.chartHeight = self.height() - self.bottomMargin - self.topMargin
示例9: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, QResizeEvent):
super(barraTitulo, self).resizeEvent(QResizeEvent)
self.frameTitulo.setFixedWidth(self.parent.width())
self.labelTitulo.setFixedWidth(self.parent.width()-62)
示例10: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, QResizeEvent):
super(barraTitulo, self).resizeEvent(QResizeEvent)
self.frameTitulo.setFixedWidth(self.parent.width())
self.labelTitulo.setFixedWidth(self.parent.width()-202)
示例11: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, event: qg.QResizeEvent) -> None:
self.view.fit_to_scene()
示例12: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, event: QResizeEvent):
self.update_views()
示例13: resizeEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QResizeEvent [as 别名]
def resizeEvent(self, event: QResizeEvent):
if self.ui.graphicsViewSpectrogram and self.ui.graphicsViewSpectrogram.sceneRect():
self.ui.graphicsViewSpectrogram.fitInView(self.ui.graphicsViewSpectrogram.sceneRect())