joelafrite
1st February 2013, 12:50
Hello,
My app uses a QPlainTextEdit-derived widget to display some data. The user should be unable to interact with the data in any way.
Currently, in my widget's constructor, I have the following:
setReadOnly(true);
setTextInteractionFlags(Qt::NoTextInteraction);
This seems to restrict most interactions. However, if the widget has focus, it is still possible to use Ctrl+A to select all the data, then Ctrl+C to copy it to the clipboard.
Is this a bug, or normal behavior? (I use Qt 4.6 btw.)
More importantly, what is the best way to prevent this? The only thing I can think of is writing my own event filter, but that seems a bit overkill/brute-force for what I'm trying to accomplish.
Thanks in advance.
My app uses a QPlainTextEdit-derived widget to display some data. The user should be unable to interact with the data in any way.
Currently, in my widget's constructor, I have the following:
setReadOnly(true);
setTextInteractionFlags(Qt::NoTextInteraction);
This seems to restrict most interactions. However, if the widget has focus, it is still possible to use Ctrl+A to select all the data, then Ctrl+C to copy it to the clipboard.
Is this a bug, or normal behavior? (I use Qt 4.6 btw.)
More importantly, what is the best way to prevent this? The only thing I can think of is writing my own event filter, but that seems a bit overkill/brute-force for what I'm trying to accomplish.
Thanks in advance.