Qt 6.12 LTS is out! See what's new in the release
blog
reading textEdit when QEvent::KeyPress is called
-
Hi, I am trying to read the textedit text whenever a new entry is added. I use:
if(event->type() == QEvent::KeyPress ){ QKeyEvent *kevent = static_cast<QKeyEvent *>(event); QString uu = ui->textEdit->toPlainText(); qDebug() << uu ; }uu does not include the latest key entry. seems the value of textEdit is not readily updated when this event occurs, and there is some sort of delay...
-
Hi, I am trying to read the textedit text whenever a new entry is added. I use:
if(event->type() == QEvent::KeyPress ){ QKeyEvent *kevent = static_cast<QKeyEvent *>(event); QString uu = ui->textEdit->toPlainText(); qDebug() << uu ; }uu does not include the latest key entry. seems the value of textEdit is not readily updated when this event occurs, and there is some sort of delay...