Qml: how to make text or label selectable?

Deadly 提交于 2021-01-26 21:39:53

问题


Let's say I have text component:

Text {      
      text: "Hello"
      wrapMode: Text.WordWrap    
}

How to make it selectable?


回答1:


That is a bug reported: QTBUG-14077, and the workaround is to use TextEdit in read-only mode:

TextEdit {
    text: "Hello"
    readOnly: true
    wrapMode: Text.WordWrap
    selectByMouse: true
}


来源:https://stackoverflow.com/questions/49784099/qml-how-to-make-text-or-label-selectable

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!