Results 1 to 3 of 3

Thread: How to set the Text Cursor in a PlainTextEdit box?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #2
    Join Date
    Feb 2007
    Location
    Karlsruhe, Germany
    Posts
    469
    Thanks
    17
    Thanked 90 Times in 88 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: How to set the Text Cursor in a PlainTextEdit box?

    try:

    .. do your changes..

    QTextCursor tc = ui->textbox->textCursor();
    tc.setPosition(ui->textbox->document()->characterCount());
    ui->textbox->setTextCursor(tc);

    Edit: misread your question at first and thought, you wanted to save/restore the cursors position.

    HIH

    Johannes
    Last edited by JohannesMunk; 27th February 2010 at 13:44.

  2. The following user says thank you to JohannesMunk for this useful post:

    Mia S. (27th February 2010)

Similar Threads

  1. QGraphicsTextItem and text cursor position via QPoint
    By Lykurg in forum Qt Programming
    Replies: 2
    Last Post: 10th July 2017, 18:38
  2. QGraphicsTextItem: How to show the text cursor?
    By breezeight in forum Qt Programming
    Replies: 1
    Last Post: 17th November 2009, 16:44
  3. Is there a way to get text from under the mouse cursor?
    By squirrel in forum Qt Programming
    Replies: 1
    Last Post: 12th July 2009, 01:39
  4. QTextEdit current cursor text format
    By afail in forum Qt Programming
    Replies: 0
    Last Post: 13th April 2009, 14:24
  5. How to synchronize text cursor and cursor in QTextEdit
    By kennyxing in forum Qt Programming
    Replies: 6
    Last Post: 18th February 2007, 09:14

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.