本文整理匯總了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())