Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QPlainTextEdit How to de-select all?
QtWS25 Last Chance

QPlainTextEdit How to de-select all?

Scheduled Pinned Locked Moved Solved General and Desktop
qplaintexteditselect allcreatorc++
3 Posts 2 Posters 3.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shellback3
    wrote on 1 Dec 2015, 20:32 last edited by
    #1

    I am attempting to learn Qt on Ubuntu and C++ and have been using the Terminal example. I've been able to selectAll() and copy() the selected text but don't see how to deselect it after I've copied it. I've not found any reference in my Google and Qt forum searches.

    How is this done?

    1 Reply Last reply
    1
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 1 Dec 2015, 20:48 last edited by mrjj 12 Jan 2015, 20:55
      #2

      hi
      try this
      QTextCursor cursor = ui->textEdit->textCursor();
      cursor.movePosition( QTextCursor::End );
      ui->textEdit->setTextCursor( cursor );

      ui->textEdit should of course be changed to the real name in your app.

      1 Reply Last reply
      2
      • S Offline
        S Offline
        shellback3
        wrote on 2 Dec 2015, 21:43 last edited by
        #3

        Thanks, worked as expected!

        1 Reply Last reply
        1

        3/3

        2 Dec 2015, 21:43

        • Login

        • Login or register to search.
        3 out of 3
        • First post
          3/3
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved