本文整理汇总了C++中QTextEdit::cut方法的典型用法代码示例。如果您正苦于以下问题:C++ QTextEdit::cut方法的具体用法?C++ QTextEdit::cut怎么用?C++ QTextEdit::cut使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类QTextEdit
的用法示例。
在下文中一共展示了QTextEdit::cut方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: replace
bool FindDialog::replace() {
bool found = find();
QTextEdit* textEdit = getCurrentTextEdit();
if (textEdit == NULL) return false;
if (found == false) return false;
textEdit->cut();
textEdit->insertPlainText(ui->replaceString->text());
return true;
}
示例2: execute
/*!
* \class TextCursorCutText
* \author Anders Fernström
* \date 2006-02-07
*
* \brief Command for cuting text
*/
void TextCursorCutText::execute()
{
Cell *cell = document()->getCursor()->currentCell();
if( cell )
{
if( typeid(InputCell) == typeid(*cell) )
{
InputCell *inputcell = dynamic_cast<InputCell*>(cell);
if( inputcell->textEditOutput()->hasFocus() &&
inputcell->isEvaluated() )
{
inputcell->textEditOutput()->copy();
}
else
inputcell->textEdit()->cut();
}
else if( typeid(GraphCell) == typeid(*cell) )
{
GraphCell *graphcell = dynamic_cast<GraphCell*>(cell);
if( graphcell->textEditOutput()->hasFocus() &&
graphcell->isEvaluated() )
{
graphcell->textEditOutput()->copy();
}
else
graphcell->textEdit()->cut();
}
else if( typeid(LatexCell) == typeid(*cell) )
{
LatexCell *latexcell = dynamic_cast<LatexCell*>(cell);
if( latexcell->textEditOutput()->hasFocus() &&
latexcell->isEvaluated() )
{
latexcell->textEditOutput()->cut();
}
else
latexcell->textEdit()->cut();
}
else
{
QTextEdit *editor = cell->textEdit();
if( editor )
{
editor->cut();
}
}
}
}
示例3: cut
void CBaseEditWindow::cut( void )
{
QTextEdit* doc = activeDocument();
if( doc != NULL ) { doc->cut(); }
}
示例4: textEditDelete
// 削除
void MainWindow::textEditDelete() {
QTextEdit* textEdit = getCurrentTextEdit();
if (textEdit == NULL) return;
//TODO
textEdit->cut();
}
示例5: textEditCut
// 切りとり
void MainWindow::textEditCut() {
QTextEdit* textEdit = getCurrentTextEdit();
if (textEdit == NULL) return;
textEdit->cut();
}