首页| 论坛| 消息

标题:怎样实现QTextEdit中的backspace(删除),里面好像没有这个现成的功能
作者:xqd008
日期:2008-09-15 23:36
内容:

请教,怎样实现QTextEdit中的backspace(删除),里面好像没有这个现成的功能?


#1 [suraid 09-16 11:22]
可能是因为QTextEdit支持富文本吧
你可以先把text取出来,操作完了再set回去,最简单的办法
#2 [lenovosoft 09-16 14:33]
重载这个类自己封装吧
#3 [xqd008 09-17 23:05]
谢谢二楼的介意.
#4 [xqd008 09-17 23:06]
我试过重载,没有成功.能告诉我具体做法吗?
#5 [q3310110 10-22 12:59]
ui.textEdit->moveCursor(QTextCursor::PreviousCharacter,QTextCursor::KeepAnchor);
ui.textEdit->cut();
ui.textEdit->setFocus();

It's meAda
problem must process by yourself.this method is simply but useful.

<< 1 2 >> (1/2)

回复 发表
主题 版块