Python PyQt5.QtCore.Qt 模块,NoModifier() 实例源码

我们从Python开源项目中,提取了以下5个代码示例,用于说明如何使用PyQt5.QtCore.Qt.NoModifier()

项目:mpvQC    作者:Frechdachs    | 项目源码 | 文件源码
def keyPressEvent(self, event):
        pressedkey = event.key()
        if ((pressedkey == Qt.Key_Up or pressedkey == Qt.Key_Down)
                and int(app.keyboardModifiers()) == Qt.NoModifier):
            super(CommentListView, self).keyPressEvent(event)
        elif pressedkey == Qt.Key_Delete:
            deleteSelection()
            event.accept()
        elif pressedkey == Qt.Key_Enter or pressedkey == Qt.Key_Return:
            editSelection()
            event.accept()
        elif pressedkey == Qt.Key_C and int(app.keyboardModifiers()) == Qt.CTRL:
            copySelection()
            event.accept()
        else:
            event.ignore()
项目:pyqt5    作者:yurisnm    | 项目源码 | 文件源码
def key_released(self):

        self.setStyleSheet(self.__style)
        if self.__str_key == "&&":
            self.__str_key = "&"
        event = QKeyEvent(QEvent.KeyPress, self.__key, Qt.NoModifier,
                          self.__str_key, False)
        QCoreApplication.postEvent(self.__receiver, event)
项目:defconQt    作者:trufont    | 项目源码 | 文件源码
def keyPressEvent(self, event):
        key = event.key()
        modifiers = event.modifiers()
        if key in (Qt.Key_Up, Qt.Key_Down, Qt.Key_Left, Qt.Key_Right):
            self._arrowKeyPressEvent(event)
        elif key == Qt.Key_Return:
            index = self._lastSelectedCell
            if index is not None:
                self.glyphActivated.emit(self._glyphs[index])
        elif modifiers in (Qt.NoModifier, Qt.ShiftModifier):
            self._glyphNameInputEvent(event)
        else:
            super(GlyphCellWidget, self).keyPressEvent(event)
项目:urh    作者:jopohl    | 项目源码 | 文件源码
def test_signal_view(self):
        self.add_signal_to_form("esaver.complex")
        signal = self.form.signal_tab_controller.signal_frames[0].signal

        tree_view = self.dialog.ui.treeViewSignals
        tree_model = tree_view.model()
        item = tree_model.rootItem.children[0].children[0]
        index = tree_model.createIndex(0, 0, item)
        rect = tree_view.visualRect(index)
        QTest.mousePress(tree_view.viewport(), Qt.LeftButton, pos=rect.center())
        mime_data = tree_model.mimeData([index])
        drag_drop = QDropEvent(rect.center(), Qt.CopyAction|Qt.MoveAction, mime_data, Qt.LeftButton, Qt.NoModifier)
        drag_drop.acceptProposedAction()
        self.dialog.ui.gVOriginalSignal.dropEvent(drag_drop)
        self.assertEqual(self.dialog.ui.gVOriginalSignal.sceneRect().width(), signal.num_samples)

        self.dialog.ui.cbShowDataBitsOnly.click()
        self.dialog.ui.chkBoxLockSIV.click()

        self.assertEqual(int(self.dialog.ui.gVOriginalSignal.view_rect().width()),
                         int(self.dialog.ui.gVModulated.view_rect().width()))

        freq = self.dialog.ui.doubleSpinBoxCarrierFreq.value()
        self.dialog.ui.btnAutoDetect.click()
        self.assertNotEqual(freq, self.dialog.ui.doubleSpinBoxCarrierFreq.value())

        self.dialog.ui.comboBoxModulationType.setCurrentText("Frequency Shift Keying (FSK)")
        self.dialog.ui.btnAutoDetect.click()

        self.assertEqual(self.dialog.ui.lCurrentSearchResult.text(), "1")
        self.dialog.ui.btnSearchNext.click()
        self.assertEqual(self.dialog.ui.lCurrentSearchResult.text(), "2")
        self.dialog.ui.btnSearchPrev.click()
        self.assertEqual(self.dialog.ui.lCurrentSearchResult.text(), "1")
项目:urh    作者:jopohl    | 项目源码 | 文件源码
def test_spectrum(self):
        port = self.__get_free_port()
        spectrum_dialog = self.__get_spectrum_dialog()
        spectrum_dialog.device.set_server_port(port)
        spectrum_dialog.ui.btnStart.click()
        self.assertEqual(len(spectrum_dialog.scene_manager.peak), 0)

        data = np.array([complex(1, 1), complex(2, 2), complex(3, 3)], dtype=np.complex64)

        sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
        sock.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)

        sock.connect(("127.0.0.1", port))
        sock.sendall(data.tostring())
        sock.shutdown(socket.SHUT_RDWR)
        sock.close()

        QApplication.instance().processEvents()
        QTest.qWait(self.SEND_RECV_TIMEOUT)

        self.assertGreater(len(spectrum_dialog.scene_manager.peak), 0)
        self.assertIsNone(spectrum_dialog.ui.graphicsViewFFT.scene().frequency_marker)
        w = spectrum_dialog.ui.graphicsViewFFT.viewport()

        # this actually gets the click to the view
        # QTest.mouseMove(w, QPoint(80,80))
        event = QMouseEvent(QEvent.MouseMove, QPoint(80, 80), w.mapToGlobal(QPoint(80, 80)), Qt.LeftButton,
                            Qt.LeftButton, Qt.NoModifier)
        QApplication.postEvent(w, event)
        QApplication.instance().processEvents()
        self.assertIsNotNone(spectrum_dialog.ui.graphicsViewFFT.scene().frequency_marker)

        spectrum_dialog.ui.btnStop.click()

        self.assertGreater(len(spectrum_dialog.ui.graphicsViewSpectrogram.items()), 0)
        spectrum_dialog.ui.btnClear.click()
        self.assertEqual(len(spectrum_dialog.ui.graphicsViewSpectrogram.items()), 0)

        self.__close_dialog(spectrum_dialog)