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. Can I disable text selection in QPlainTextEdit?
Forum Updated to NodeBB v4.3 + New Features

Can I disable text selection in QPlainTextEdit?

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 2 Posters 3.9k 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.
  • M Offline
    M Offline
    Mr Pang
    wrote on last edited by
    #1

    I want to prohibit the user to select text in QPlainTextEdit Area using mouse button. The text can only selected by code(such as QPlainTextEdit::find() ).
    Is this possible?

    RatzzR 1 Reply Last reply
    0
    • M Mr Pang

      I want to prohibit the user to select text in QPlainTextEdit Area using mouse button. The text can only selected by code(such as QPlainTextEdit::find() ).
      Is this possible?

      RatzzR Offline
      RatzzR Offline
      Ratzz
      wrote on last edited by Ratzz
      #2

      @Mr-Pang
      You may try this.

          ui->plainTextEdit->setTextInteractionFlags(Qt::TextEditable);
      

      or you may do it in the designer under property textInteractionFlags

      --Alles ist gut.

      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