Details
-
Suggestion
-
Resolution: Unresolved
-
Not Evaluated
-
None
-
6.0.0
-
None
Description
QTextEdit::createStandardContextMenu(QPoint) takes the coordinates in document coordinates which is completely inconsistent:
- no other function takes a point in document coordinates (e.g. anchorAt(), cursorForPosition())
- there is no public api to get the document coordinates from the QTextEdit
The only workaround which emulates the anchorAt/cursorForPosition behavior is
void MainWindow::OnShowContextMenu(const QPoint& pos) { QPoint p = pos + QPoint(ui->textBrowser->horizontalScrollBar()->value(), ui->textBrowser->verticalScrollBar()->value()); QMenu* menu = ui->textBrowser->createStandardContextMenu(p); ...
I see two options here:
- break SC in Qt6 and syn it with the other functions
- document this strange behavior and live with it until Qt7
Attachments
Issue Links
- relates to
-
QTBUG-89157 Binary/Source incompatible changes to consider within Qt 6
- Open