VireX
3rd April 2007, 07:35
See I have a text browser that works great, I use
insertHtml("<br>%1") for texts, and it works great.. I add this line over and over, and it makes a new line each time. Until the user clicks on the QTextBrowser (like somewhere on it), and thats when it messes up and starts inserting it in the middle of the page, or wherever the QTextBrowser is clicked.
I tried doing this to keep the cursor at the end of all the TEXT. However, this did not work:
qtxtbrowser->textCursor().clearSelection();
qtxtbrowser->textCursor().movePosition(QTextCursor::End);
qtxtbrowser->insertHtml(qsData+"<br>");
I also thought about doing something like this: qtxtbrowser->mousePressEvent(QMouseEvent(QEvent::MouseButtonPre ss, QPoint(1,1), Qt::LeftButton, ));
but I have no clue how to do this, and there are no examples anywhere I looked.
Is there a way to disable this left click feature or just keep the cursor at the bottom of all the inserted text?
insertHtml("<br>%1") for texts, and it works great.. I add this line over and over, and it makes a new line each time. Until the user clicks on the QTextBrowser (like somewhere on it), and thats when it messes up and starts inserting it in the middle of the page, or wherever the QTextBrowser is clicked.
I tried doing this to keep the cursor at the end of all the TEXT. However, this did not work:
qtxtbrowser->textCursor().clearSelection();
qtxtbrowser->textCursor().movePosition(QTextCursor::End);
qtxtbrowser->insertHtml(qsData+"<br>");
I also thought about doing something like this: qtxtbrowser->mousePressEvent(QMouseEvent(QEvent::MouseButtonPre ss, QPoint(1,1), Qt::LeftButton, ));
but I have no clue how to do this, and there are no examples anywhere I looked.
Is there a way to disable this left click feature or just keep the cursor at the bottom of all the inserted text?