Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.5.0, 5.9.6
-
Windows 8
-
a4f79313f065815451610dabdbbb33b8a35f0a86 (qt/qtbase/5.12)
Description
The find bachward flag skips the first previous occurence of a search
Here is the procedure :
void MainWindow::findNext(QString texte,bool fBackward,bool fCaseSensitive, bool fWholeWord) { QTextDocument::FindFlags flag=0; if (fBackward) flag= QTextDocument::FindBackward; if (fCaseSensitive) flag = flag | QTextDocument::FindCaseSensitively; if (fWholeWord) flag = flag | QTextDocument::FindWholeWords; bool f=textEdit->find(texte,flag); } Attached is the example which can be used to see this. Steps Run the example Bring the cursor at the beginning of the last 'a' in list then click Button "search backward for 'a'"
If in the textedit document there is the following text (a "a" character on each line as shown)
a a a a
When the cursor is at the end of the document, the find backward mode skips one "a" on 2.
Attachments
For Gerrit Dashboard: QTBUG-48035 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
263657,5 | Fix: QTextDocument::find backward search crossing paragraphs | 5.12 | qt/qtbase | Status: MERGED | +2 | 0 |