if (currentText->textCursor().selectedText()==this->comboBoxFind->lineEdit()->text())//当cursor选择内容与查找内容一致时,才进行替换
{currentText->textCursor().insertText(this->comboBoxReplace->lineEdit()->text());
this->HTextEditorFindNext();}
else
{this->HTextEditorFindNext();}//查找下一个
注:
currentText为要进行编辑的TextEdit
this->comboBoxFind->lineEdit()->text()为要被查找的内容
this->comboBoxReplace->lineEdit()->text()为用来替换的内容
这个是Replace Next的实现
[ 此帖被iiiyyyhhhsss在2009-09-22 15:28重新编辑 ]