开发者

Disable text selection in QT/WebKit GUI

I'm checking if it would be possible to implement a GUI using HTML through PyQT and WebKit. One of the problem is that using the mouse you can select the text making up the interface. Can this behaviour be disabled?

Also, the mouse pointer changes to an insertion caret while over the selectable text. I woul开发者_StackOverflow中文版d like to disable this, without disabling the hand mouse pointer which appears when over a clickable link.


That's how I am doing it:

cursor: default;
-webkit-user-select: none;

I am working on something quite similar, a desktop app with html/css-based interface. The above code takes care of text selection and the caret. Set css property cursor to pointer for your links, something like:

a { cursor: pointer; }


You can use javascript to "return false" on the start selection event in order to disable the text selection.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜