Unsolved is it possible to to Ctrl C on QLabel
-
is it possible to to Ctrl C and Control V on QLabel
-
Hi
Yes it is possible by setting the textInteractionFlags of your QLabel:
http://doc.qt.io/qt-5/qlabel.html#textInteractionFlags-prop
You to choose :
Qt::TextSelectableByMouse
which means :Text can be selected with the mouse and copied to the clipboard using a context menu or standard keyboard shortcuts.
this is the list of possible interaction flags:
http://doc.qt.io/qt-5/qt.html#TextInteractionFlag-enum
Your code have to look to something like this:
label->setTextInteractionFlags(Qt::TextSelectableByMouse);
I hope this can help you !
-
Hi,
To add to @mostefa, you can't past on a QLabel unless you implement that yourself.
However if you want both options, why not use a QLineEdit ?
-
I dont want to paste on QLable but want to copy this QLable and paste it to other places
-
@Qt-Enthusiast said in is it possible to to Ctrl C on QLabel:
I dont want to paste on QLable but want to copy this QLable and paste it to other places
Then , as i suggested , you can use
label->setTextInteractionFlags(Qt::TextSelectableByMouse);