xpam/mainwindow.cpp
//Deletes last line in text browser

Deletes last line in text browser
Deletes last line in text browser
void MainWindow::removeLastLine() {
    ui->textBrowserUpdate->setFocus();
    QTextCursor storeCursorPos = ui->textBrowserUpdate->textCursor();
    ui->textBrowserUpdate->moveCursor(QTextCursor::End, QTextCursor::MoveAnchor);
    ui->textBrowserUpdate->moveCursor(QTextCursor::StartOfLine, QTextCursor::MoveAnchor);
    ui->textBrowserUpdate->moveCursor(QTextCursor::End, QTextCursor::KeepAnchor);
    ui->textBrowserUpdate->textCursor().removeSelectedText();
    ui->textBrowserUpdate->textCursor().deletePreviousChar();
    ui->textBrowserUpdate->setTextCursor(storeCursorPos);
}
void MainWindow :: removeLastLine ( ) { ui -> textBrowserUpdate -> setFocus ( ) ; QTextCursor storeCursorPos = ui -> textBrowserUpdate -> textCursor ( ) ; ui -> textBrowserUpdate -> moveCursor ( QTextCursor :: End , QTextCursor :: MoveAnchor ) ; ui -> textBrowserUpdate -> moveCursor ( QTextCursor :: StartOfLine , QTextCursor :: MoveAnchor ) ; ui -> textBrowserUpdate -> moveCursor ( QTextCursor :: End , QTextCursor :: KeepAnchor ) ; ui -> textBrowserUpdate -> textCursor ( ) . removeSelectedText ( ) ; ui -> textBrowserUpdate -> textCursor ( ) . deletePreviousChar ( ) ; ui -> textBrowserUpdate -> setTextCursor ( storeCursorPos ) ; }
Deletes last line in text browser
Deletes last line in text browser