PDA

View Full Version : deleting frames in QTextEdit



GrahamLabdon
9th March 2012, 09:55
Hi
I am experimenting with QTextEdit and frames.
I have a small app in which I insert frames in response to a menu action.
The frame gets inserted correctly but when I delete text using the backspace key I can only delete to the beginning of the frame.

Does anyone know the reason for this?

the code that inserts the frame –


void MainWindow::on_actionFrame_triggered()
{
QTextCharFormat charFormat;
charFormat.setFontPointSize(20);
ui->textEdit->textCursor().mergeCharFormat(charFormat);
ui->textEdit->textCursor().insertText(QString::number(m_frameNum ber++) + "Frame");
QTextFrameFormat frameFormat;
ui->textEdit->textCursor().insertFrame(frameFormat);
}


Thanks

Graham