本文整理汇总了Python中qtpy.QtCore.QEvent方法的典型用法代码示例。如果您正苦于以下问题:Python QtCore.QEvent方法的具体用法?Python QtCore.QEvent怎么用?Python QtCore.QEvent使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类qtpy.QtCore
的用法示例。
在下文中一共展示了QtCore.QEvent方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: resizeEvent
# 需要导入模块: from qtpy import QtCore [as 别名]
# 或者: from qtpy.QtCore import QEvent [as 别名]
def resizeEvent(self, event):
"""
Re-implemented to re-calculate the grid size to provide scaling icons
Parameters
----------
event : QtCore.QEvent
"""
width = self.viewport().width() - 30
# The minus 30 above ensures we don't end up with an item width that
# can't be drawn the expected number of times across the view without
# being wrapped. Without this, the view can flicker during resize
tileWidth = width / VIEW_COLUMNS
iconWidth = int(tileWidth * 0.8)
self.setGridSize(QtCore.QSize(tileWidth, tileWidth))
self.setIconSize(QtCore.QSize(iconWidth, iconWidth))
return super().resizeEvent(event)
示例2: assert_pyside
# 需要导入模块: from qtpy import QtCore [as 别名]
# 或者: from qtpy.QtCore import QEvent [as 别名]
def assert_pyside():
"""
Make sure that we are using PySide
"""
import PySide
assert QtCore.QEvent is PySide.QtCore.QEvent
assert QtGui.QPainter is PySide.QtGui.QPainter
assert QtWidgets.QWidget is PySide.QtGui.QWidget
assert QtWebEngineWidgets.QWebEnginePage is PySide.QtWebKit.QWebPage
示例3: assert_pyside2
# 需要导入模块: from qtpy import QtCore [as 别名]
# 或者: from qtpy.QtCore import QEvent [as 别名]
def assert_pyside2():
"""
Make sure that we are using PySide
"""
import PySide2
assert QtCore.QEvent is PySide2.QtCore.QEvent
assert QtGui.QPainter is PySide2.QtGui.QPainter
assert QtWidgets.QWidget is PySide2.QtWidgets.QWidget
assert QtWebEngineWidgets.QWebEnginePage is PySide2.QtWebEngineWidgets.QWebEnginePage
示例4: assert_pyqt4
# 需要导入模块: from qtpy import QtCore [as 别名]
# 或者: from qtpy.QtCore import QEvent [as 别名]
def assert_pyqt4():
"""
Make sure that we are using PyQt4
"""
import PyQt4
assert QtCore.QEvent is PyQt4.QtCore.QEvent
assert QtGui.QPainter is PyQt4.QtGui.QPainter
assert QtWidgets.QWidget is PyQt4.QtGui.QWidget
assert QtWebEngineWidgets.QWebEnginePage is PyQt4.QtWebKit.QWebPage
示例5: assert_pyqt5
# 需要导入模块: from qtpy import QtCore [as 别名]
# 或者: from qtpy.QtCore import QEvent [as 别名]
def assert_pyqt5():
"""
Make sure that we are using PyQt5
"""
import PyQt5
assert QtCore.QEvent is PyQt5.QtCore.QEvent
assert QtGui.QPainter is PyQt5.QtGui.QPainter
assert QtWidgets.QWidget is PyQt5.QtWidgets.QWidget
if QtWebEngineWidgets.WEBENGINE:
assert QtWebEngineWidgets.QWebEnginePage is PyQt5.QtWebEngineWidgets.QWebEnginePage
else:
assert QtWebEngineWidgets.QWebEnginePage is PyQt5.QtWebKitWidgets.QWebPage
示例6: mouseReleaseEvent
# 需要导入模块: from qtpy import QtCore [as 别名]
# 或者: from qtpy.QtCore import QEvent [as 别名]
def mouseReleaseEvent(self, event: QEvent):
"""Show QColorPopup picker when the user clicks on the swatch."""
if event.button() == Qt.LeftButton:
initial = QColor(*(255 * self._color).astype('int'))
popup = QColorPopup(self, initial)
popup.colorSelected.connect(self.setColor)
popup.show_right_of_mouse()
示例7: keyPressEvent
# 需要导入模块: from qtpy import QtCore [as 别名]
# 或者: from qtpy.QtCore import QEvent [as 别名]
def keyPressEvent(self, event: QEvent):
event.ignore()
示例8: dropEvent
# 需要导入模块: from qtpy import QtCore [as 别名]
# 或者: from qtpy.QtCore import QEvent [as 别名]
def dropEvent(self, event: QEvent):
"""Triggered when the user moves & drops one of the items in the list.
Parameters
----------
event : QEvent
The event that triggered the dropEvent.
"""
super().dropEvent(event)
order = [self.item(r).hook_implementation for r in range(self.count())]
self.order_changed.emit(order)