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?
Forum Update on Monday, May 27th 2025

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 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
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by mrjj
      #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 last edited by
        #3

        Thanks, worked as expected!

        1 Reply Last reply
        1

        • Login

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