+ } else if(clickMode == ChatScene::DoubleClick) {
+ chatScene()->setSelectingItem(this);
+ setSelectionMode(PartialSelection);
+ Clickable click = privateData()->currentClickable;
+ if(click.isValid()) {
+ setSelectionStart(click.start);
+ setSelectionEnd(click.start + click.length);
+ } else {
+ // find word boundary
+ QString str = data(ChatLineModel::DisplayRole).toString();
+ qint16 cursor = posToCursor(pos);
+ qint16 start = str.lastIndexOf(QRegExp("\\W"), cursor) + 1;
+ qint16 end = qMin(str.indexOf(QRegExp("\\W"), cursor), str.length());
+ if(end < 0) end = str.length();
+ setSelectionStart(start);
+ setSelectionEnd(end);
+ }
+ update();
+ } else if(clickMode == ChatScene::TripleClick) {
+ setSelection(PartialSelection, 0, data(ChatLineModel::DisplayRole).toString().length());