當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。