Important: Please read the Qt Code of Conduct -

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

  • 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!

  • In general an enabled widget handles keyboard and mouse events; a disabled widget does not. An exception is made with QAbstractButton. "QWidget": If there aren't a lot of disabled controls, maybe you can have a button that copies content to the clipboard.

Log in to reply