【问题标题】:How to get x and y position of QTextCursor (not .position()) in QTextEdit?如何在 QTextEdit 中获取 QTextCursor(不是 .position())的 x 和 y 位置?
【发布时间】:2013-02-06 18:15:46
【问题描述】:

例如,我想要一个带有变量列表的弹出窗口,就像代码编辑器中经常出现的那样。为此,我需要知道 QTextEdit 中 QTextCursor 的 x 和 y 位置。但唯一看起来合理的函数是 int QTextCursor::verticalMovementX () const。为什么没有 QTextCursor::horisontalMovementX()?

【问题讨论】:

标签: qt


【解决方案1】:

我想你要找的是QTextEdit::cursorRect()

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多