Hi,
I have a QTextEdit in read only mode where information is displayed in continuous.
For example:
User 1: message sent
User 2: message received
User 3: message sent
User 2: message received
User 2: message sent
...
I have a QComboBox with the items:
all
user 1
user 2
user 3
I would like when I select an item in the QComboBox, display messages on my user
First of all, I count the number of rows in my QTextEdit:
int = number_row text_edit-> document () -> blockcount ();
int = number_row text_edit-> document () -> blockcount ();
To copy to clipboard, switch view to plain text mode
Then I browse the rows with a for loop:
for (int i = 0; i <number_row; i + +)
{
}
for (int i = 0; i <number_row; i + +)
{
}
To copy to clipboard, switch view to plain text mode
However, I can not retrieve rows of the user 1 in my textedit if the selected item in the QComboBox is User 1 for example.
I tried with QTextCursor but it is difficult.
If anyone knows ...
Bookmarks