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. QTextEdit Block clear..?
Forum Updated to NodeBB v4.3 + New Features

QTextEdit Block clear..?

Scheduled Pinned Locked Moved Unsolved General and Desktop
2 Posts 2 Posters 261 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.
  • P Offline
    P Offline
    Pada_
    wrote on last edited by Pada_
    #1

    How can I block-clear a selected character (drag block character) of QTextEdit?

    0_1548116540294_778543b5-60e8-452a-8c28-f534f4b2ead4-image.png

    1 Reply Last reply
    0
    • Maaz MominM Offline
      Maaz MominM Offline
      Maaz Momin
      wrote on last edited by Maaz Momin
      #2

      Use if(QTextCursor::hasSelection()) QTextCursor::removeSelectedText()

      Edit:
      QTextCursor textCursor = textEdit->textCursor();
      if(textCursor.hasSelection())
      {
      textCursor.removeSelectedText()
      }

      1 Reply Last reply
      3

      • Login

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