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