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. How to allow copying text from all (including disabled/readOnly) QLineEdit widgets in a window
Forum Updated to NodeBB v4.3 + New Features

How to allow copying text from all (including disabled/readOnly) QLineEdit widgets in a window

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 2.9k Views 2 Watching
  • 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.
  • D Offline
    D Offline
    d.oberkofler
    wrote on last edited by
    #1

    We would like to allow copy operations also all (including "disabled") edit controls:

    1. We have tried to disable them but this seems to make it generally impossible in Qt to select the content and copy it
    2. We have tried to make read-only but then it is possible to navigate them using tab and even the initial focus might be set to them
      I'm sure we just miss something and it would be great if someone could help us out.
      Thank you in advance!
    1 Reply Last reply
    1
    • M Offline
      M Offline
      melghawi
      wrote on last edited by
      #2

      In general an enabled widget handles keyboard and mouse events; a disabled widget does not. An exception is made with QAbstractButton. "QWidget":http://qt-project.org/doc/qt-4.8/qwidget.html#enabled-prop. If there aren't a lot of disabled controls, maybe you can have a button that copies content to the clipboard.

      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