Hi,
I want that my customized QGraphicsTextItem only stays in one line and don't accept whitespace. Therefore I have reimplemented keypressevent as following:
Qt Code:
{ if (event->key() != Qt::Key_Space && event->key() != Qt::Key_Tab && event->key() != Qt::Key_Return) }To copy to clipboard, switch view to plain text mode
Spaces and return are blocked correct but Qt::Key_Tab seems to never reach this eventhandler. So a tabulator is still entered in the items editor. How to avoid that?
2nd question: How to catch past events to avoid special characters and different font style? (maybe without subclassing QTextDocument?)
Thanks,
Lykurg
Bookmarks