Logo Search packages:      
Sourcecode: mateedit version File versions  Download package

void MateEditMainWindow::slotEditCut (  )  [slot]

Paste Clipboard content to text

Definition at line 1054 of file mateedit.cpp.

References MateEdit::MateEdit::deleteText().

Referenced by MateEditMainWindow().

{
    if ( m_textfield->hasSelectedText() )
    {
        QClipboard *cb = KApplication::kApplication()->clipboard();
        QString text = m_textfield->selectedText();
        cb->setText( text, QClipboard::Clipboard );

        int paraFrom;
        int indexFrom;
        int paraTo;

        int indexTo;
        m_textfield->getSelection( &paraFrom, &indexFrom, &paraTo, &indexTo );

        int rtc;
        rtc = m_mateedit->deleteText( m_textfield->selectedText(), paraFrom, indexFrom, paraTo, indexTo );
        undo_stack.push(rtc);

        m_textfield->removeSelectedText();  //remove here so we get a correct cursor position
    }
}


Generated by  Doxygen 1.6.0   Back to index