Search text in QPlainTextEdit
-
wrote on 27 Jun 2020, 03:22 last edited by
hello,
I'm developing a text editor with Python and Qt.
now i want to search for text in a QPlainTextEdit ('').
How do you program something like that? -
wrote on 27 Jun 2020, 06:38 last edited by
i found this:
https://doc.qt.io/archives/4.6/uitools-textfinder.htmlbut I can't rewrite it in Python. Can someone help please?
-
i found this:
https://doc.qt.io/archives/4.6/uitools-textfinder.htmlbut I can't rewrite it in Python. Can someone help please?
wrote on 27 Jun 2020, 07:06 last edited by@PythonQTMarlem
If you want to copy that, you simply have to go through it line-by-line and translate the C++ into Python. Personally I don't think that's difficult, but your mileage may vary.now i want to search for text in a QPlainTextEdit ('').
This is just https://doc.qt.io/qt-5/qplaintextedit.html#find. That will exist in PySide2/PyQt5.
-
wrote on 27 Jun 2020, 10:21 last edited by
hi,
i try. but now i don't know how to convert this in python:
QTextCursor highlightCursor(document); QTextCursor cursor(document);
I would appreciate a suggestion.
-
wrote on 27 Jun 2020, 11:02 last edited by
solution:
highlightCursor = QTextCursor(self.document) cursor = QTextCursor(document)
1/5