Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
QTextEdit でカーソルの行番号を取得できます。しかし、列番号情報を取得することはできません。(注: 行番号情報を取得するときに QTextBlock を使用します。) 列番号を取得する簡単な方法はありませんか? 私は何をすべきか?私はこことここを読んでいますが、 QTextBlock クラスはまだ私を混乱させています。
これは問題に対する私の解決策です:
QTextCursor cursor = ui.textEdit->textCursor(); int y = cursor.blockNumber() + 1; int x = cursor.columnNumber() + 1;