Qt recognition of line segments

Does Qt have the ability to recognize that you write a list of letters after each letter in order to turn it into a widget with an x button (like Gmail). Is there any built-in functionality for this or should it be done from scratch?

+5
source share
2 answers

I think it is easier to use LineEdit and listen for the onchange signal. In swap slot search email inside LineEdit text using RegExp. If you find a suitable email address (possibly surrounded by spaces), add a shortcut with a delete icon in front of LineEdit and remove the added email from the LineEdit text. It's all!

0
source

I think you can take a look at the QtGraphics QtGui sub-module, especially the QGraphicsTextItem and QGraphicsScene.

You just need to control the layout (or use the existing one), the appearance of the elements and remove the buttons .

Even if it's almost from scratch, you won't have to code the rendering.

0
source

All Articles