Hi Everyone.
I've got an app that has the ability to create editable text box graphics items. Now I have the problem that I need actions to work differently depending on whether an item is currently being edited.
For example, the copy action can either copy selected text or copy a whole box, depending on whether text is being edited or not. Same with delete, select all, etc.
So far I've just been creating menu actions that select all items and such, and then overriding QGraphicsScene::keyPressEvent and checking if a box is being edited (and then ignoring keypresses like del). This isn't a very good solution, as I need to check every possible action, and it doesn't handle the scenario of the user selecting actions with the mouse.
So it seems there should be something better. I was looking at the ShortcutOverride events, but I'm not sure how to use them.. My GraphicsScene doesn't get any of those types of events.
IS there something basic I'm missing? How can I make actions do two different things based on an editing text graphics item without checking manually every time? Is there built in support for this? Thanks.
Bookmarks