case_text_edit.py 文件源码

python
阅读 18 收藏 0 点赞 0 评论 0

项目:uitester 作者: IfengAutomation 项目源码 文件源码
def keyPressEvent(self, e):
        completion_prefix = self.text_under_cursor()
        if self.cmp and self.popup_widget.func_list_widget.isVisible():
            current_row = self.popup_widget.func_list_widget.currentRow()
            if e.key() == Qt.Key_Down:
                self.current_item_down(current_row)
                return

            if e.key() == Qt.Key_Up:
                self.current_item_up(current_row)
                return

            if e.key() in (Qt.Key_Return, Qt.Key_Enter):
                selected_word = self.popup_widget.func_list_widget.currentItem().text()
                self.insert_func_name_signal.emit(completion_prefix, selected_word)
                return

        if e.key() in (Qt.Key_Return, Qt.Key_Enter):
            self.parse_content()

        is_shortcut = ((e.modifiers() & Qt.ControlModifier) and e.key() == Qt.Key_E)  # shortcut key:ctrl + e
        if is_shortcut:
            self.cmp.update("", self.popup_widget)
            self.update_popup_widget_position()
            self.activateWindow()
            return

        if not self.cmp or not is_shortcut:
            super(TextEdit, self).keyPressEvent(e)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号