[Qt-creator] R.I.P. for QPlainTextEdit in Qr Creator 17?
Henry Skoglund
henry at tungware.se
Wed Jun 18 18:05:08 CEST 2025
Hi, just updated to Qt Creator 17 and it looks good, however when
rebuilding my Qt Creator plugin I got stuck for a bit with this failing:
auto pe =
qobject_cast<QPlainTextEdit*>(EditorManager::currentEditor()->widget());
For almost 15 years that statement served me well and it allowed for
example setting a fatter cursor at Qt Creator start (useful on 4K
screens) but today, it returns a nullptr :-(
Instead, the new incantation for Qt Creator 17 (and onwards?) seems to be:
auto pe =
qobject_cast<Utils::PlainTextEdit*>(EditorManager::currentEditor()->widget());
After that fix, it's smooth sailing (Utils::PlainTextEdit behaves 100%
compatible with QPlainTextEdit).
But if there was a bit of documentation of this new class in the Utils::
Namespace I would be even more happy!
Rgrds Henry
More information about the Qt-creator
mailing list