本文整理汇总了Python中PyQt5.QtGui.QShowEvent方法的典型用法代码示例。如果您正苦于以下问题:Python QtGui.QShowEvent方法的具体用法?Python QtGui.QShowEvent怎么用?Python QtGui.QShowEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyQt5.QtGui
的用法示例。
在下文中一共展示了QtGui.QShowEvent方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: showEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QShowEvent [as 别名]
def showEvent(self, event: QShowEvent):
self.adjustSize()
self.parent.adjustSize()
示例2: eventFilter
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QShowEvent [as 别名]
def eventFilter(self, obj, event):
def is_colors_dialog():
return isinstance(
obj, QDialog) and 'IDA Colors' in obj.windowTitle()
if isinstance(event, QShowEvent) and is_colors_dialog():
qApp.removeEventFilter(self)
# Hide window and find &Import button
obj.windowHandle().setOpacity(0)
buttons = [widget for widget in obj.children() if isinstance(
widget, QDialogButtonBox)][0]
button = [widget for widget in buttons.buttons() if widget.text()
== '&Import'][0]
with NativeHook(ask_file=self.ask_file_handler):
button.click()
QTimer.singleShot(0, lambda: obj.accept())
return 1
return 0
示例3: event
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QShowEvent [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)
示例4: showEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QShowEvent [as 别名]
def showEvent(self, event: QShowEvent) -> None:
if self.content.verticalScrollBar().isVisible() \
and (self.parent.parent.parent.stylename == 'fusion' or sys.platform in {'win32', 'darwin'}):
self.content.setStyleSheet('''
QTextBrowser {{
border-left: none;
border-right: 1px solid {0};
border-top: 1px solid {0};
border-bottom: 1px solid {0};
background-color: transparent;
}}'''.format('#4D5355' if self.parent.parent.theme == 'dark' else '#C0C2C3'))
super(KeyframesDialog, self).showEvent(event)
示例5: showEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QShowEvent [as 别名]
def showEvent(self, event: QShowEvent) -> None:
self.clearSpinners()
super(GeneralPage, self).showEvent(event)
示例6: showEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QShowEvent [as 别名]
def showEvent(self, event: QShowEvent):
self.parent.consoleLogger.flush()
super(ConsoleWidget, self).showEvent(event)
示例7: showEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QShowEvent [as 别名]
def showEvent(self, event: QShowEvent) -> None:
if hasattr(self, 'filterProgressBar') and self.filterProgressBar.isVisible():
self.filterProgressBar.update()
super(VideoCutter, self).showEvent(event)
示例8: showEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QShowEvent [as 别名]
def showEvent(self, e: QShowEvent):
if self.movie.state() == QMovie.NotRunning:
self.movie.start()
示例9: showEvent
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QShowEvent [as 别名]
def showEvent(self, event: QtGui.QShowEvent):
"""
Initialize column and row sizes on the first time the widget is shown
"""
if not self._loaded:
# Set column widths
for column_index in range(self.columnHeader.model().columnCount()):
self.auto_size_column(column_index)
# Set row heights
# Just sets a single uniform row height based on the first N rows for performance.
N = 100
default_row_height = 30
for row_index in range(self.indexHeader.model().rowCount())[:N]:
self.auto_size_row(row_index)
height = self.indexHeader.rowHeight(row_index)
default_row_height = max(default_row_height, height)
# Set limit for default row height
default_row_height = min(default_row_height, 100)
self.indexHeader.verticalHeader().setDefaultSectionSize(default_row_height)
self.dataView.verticalHeader().setDefaultSectionSize(default_row_height)
self._loaded = True
event.accept()
示例10: eventFilter
# 需要导入模块: from PyQt5 import QtGui [as 别名]
# 或者: from PyQt5.QtGui import QShowEvent [as 别名]
def eventFilter(self, obj, ev): # noqa: N802
# Is it a QShowEvent on a QDialog named "Dialog"?
if (
ev.__class__ == ev,
QShowEvent
and obj.__class__ == QDialog
and obj.windowTitle() == "About",
):
# Find a child QGroupBox
for groupBox in obj.children():
if groupBox.__class__ == QGroupBox:
# Find a child QLabel with an icon
for label in groupBox.children():
if isinstance(label, QLabel) and label.pixmap():
self._replace_icon(label)
# Is it a QContextMenuEvent on a QWidget?
if isinstance(obj, QWidget) and isinstance(ev, QContextMenuEvent):
# Find a parent titled "IDA View"
parent = obj
while parent:
if parent.windowTitle().startswith("IDA View"):
# Intercept the next context menu
self._intercept = True
parent = parent.parent()
# Is it a QShowEvent on a QMenu?
if isinstance(obj, QMenu) and isinstance(ev, QShowEvent):
# Should we intercept?
if self._intercept:
self._insert_menu(obj)
self._intercept = False
# Is it a ToolTip event on a QWidget with a parent?
if (
ev.type() == QEvent.ToolTip
and obj.__class__ == QWidget
and obj.parent()
):
table_view = obj.parent()
# Is it a QTableView with a parent?
if table_view.__class__ == QTableView and table_view.parent():
func_window = table_view.parent()
# Is it a QWidget titled "Functions window"?
if (
func_window.__class__ == QWidget
and func_window.windowTitle() == "Functions window"
):
self._set_tooltip(obj, ev)
return False