chezifresh
4th January 2011, 21:37
I want to create a widget for entering and editing tags. Flickr has a similar interface, but I'd like to take it one step further.
I'd like to create something like this:
5689
I have comma separated auto-complete working using a QCompleter (see http://www.qtcentre.org/threads/8098-Commaseparated-list-with-inline-completion-with-QLineEdit-and-QCompleter)
The idea is the user enters a tag followed by a comma, or by hitting enter, this in turn would create on of those blue tag bubbles. You can click on the 'x' in the tag to delete it, or select it and delete it. I'm looking for some good ideas on how to create such a widget. It seems rather hard to do just by customizing a QLineEdit. I thought I'd address the collective genius of QtCentre for any ideas.
FYI: I tried overloading the paint method on a QLineEdit and was able to draw the individual tag widgets but then I wasn't able to draw the rest of the line edit correctly, ie the blinking cursor, selected/deselected text etc.
I'd like to create something like this:
5689
I have comma separated auto-complete working using a QCompleter (see http://www.qtcentre.org/threads/8098-Commaseparated-list-with-inline-completion-with-QLineEdit-and-QCompleter)
The idea is the user enters a tag followed by a comma, or by hitting enter, this in turn would create on of those blue tag bubbles. You can click on the 'x' in the tag to delete it, or select it and delete it. I'm looking for some good ideas on how to create such a widget. It seems rather hard to do just by customizing a QLineEdit. I thought I'd address the collective genius of QtCentre for any ideas.
FYI: I tried overloading the paint method on a QLineEdit and was able to draw the individual tag widgets but then I wasn't able to draw the rest of the line edit correctly, ie the blinking cursor, selected/deselected text etc.