launch_gui.py 文件源码

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

项目:spyking-circus 作者: spyking-circus 项目源码 文件源码
def overwrite_text(cursor, text):
    text_length = len(text)
    cursor.clearSelection()
    # Select the text after the current position (if any)
    current_position = cursor.position()
    cursor.movePosition(QTextCursor.Right,
                        mode=QTextCursor.MoveAnchor,
                        n=text_length)
    cursor.movePosition(QTextCursor.Left,
                        mode=QTextCursor.KeepAnchor,
                        n=cursor.position()-current_position)
    # Insert the text (will overwrite the selected text)
    cursor.insertText(text)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号