How to get text of last line from QTextEdit, and how to set cursor at the end of line or text? Actually I want to blink the cursor at the end of text when textedit get focus through code.
How to get text of last line from QTextEdit, and how to set cursor at the end of line or text? Actually I want to blink the cursor at the end of text when textedit get focus through code.
Rajesh Kumar Singh
Bangalore, India.
Qt Search
Must Watch:
See how we can connect digital world objects to our day to day life….
You can go to any part of the document and play with it using
QTextDocument
QTextBlock
QTextCursor
and probably some other related classes.
Mithin
www.mithin.in
have a look on file:Originally Posted by rajesh
http://ciz.ch/svnciz/_STATIC_LIBS_QT...it/html_edit.h
http://ciz.ch/svnciz/_STATIC_LIBS_QT.../html_edit.cpp
this sample make a href link or unlink a text
Qt Code:
void HTML_Edit::makehrefLink() { bool is_selected = html_area->textCursor().hasSelection(); if (vol_18->isChecked()) { QString ltext; if (sthtml.size() < 1) { sthtml= "Text to link"; } Href_Gui::self( this )->text_href->setText(sthtml); Href_Gui::self( this )->exec(); if (Href_Gui::self) { if (data.count() > 0) { /*qDebug() << "### linerr rrr " << QString(data.at(0)); qDebug() << "### linerr rrr " << QString(data.at(1)); qDebug() << "### linerr rrr " << QString(data.at(2));*/ html_area->textCursor().insertFragment(fragment); vol_18->setChecked(false); } } } else { html_area->textCursor().insertFragment(fragment); } }To copy to clipboard, switch view to plain text mode
Bookmarks