Make QLabel text selectable?

Code

The text of a QLabel can be made selectable by mouse like so:

label->setTextInteractionFlags(Qt::TextSelectableByMouse);

This is found in the QLabel documentation.

You can use that same function to make links selectable by keyboard, highlight URL links, and make the text editable. See Qt::TextInteractionFlag.

Designer

Search for textInteractionFlags under the QLabel menu and set the flag TextSelectableByMouse.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)