当前位置: 首页>>代码示例>>Python>>正文


Python QtCore.QEvent方法代码示例

本文整理汇总了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) 
开发者ID:spyder-ide,项目名称:qtawesome,代码行数:21,代码来源:icon_browser.py

示例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 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:11,代码来源:test_main.py

示例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 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:11,代码来源:test_main.py

示例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 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:11,代码来源:test_main.py

示例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 
开发者ID:birforce,项目名称:vnpy_crypto,代码行数:14,代码来源:test_main.py

示例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() 
开发者ID:napari,项目名称:napari,代码行数:9,代码来源:qt_color_dialog.py

示例7: keyPressEvent

# 需要导入模块: from qtpy import QtCore [as 别名]
# 或者: from qtpy.QtCore import QEvent [as 别名]
def keyPressEvent(self, event: QEvent):
        event.ignore() 
开发者ID:napari,项目名称:napari,代码行数:4,代码来源:qt_color_dialog.py

示例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) 
开发者ID:napari,项目名称:napari,代码行数:13,代码来源:qt_plugin_sorter.py


注:本文中的qtpy.QtCore.QEvent方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。