[Interest] Writing custom Qt Widgets is overly complicated

Jonathan Purol contact at folling.de
Wed Apr 29 21:59:24 CEST 2020


> Use a separate QLabel for each tag, and a single QLineEdit with
> clearButtonEnabled=true that is initially hidden.  In each label's
> onClick, hide the label and insert the edit with the same text
> immediately after it in the layout.  When the focus leaves the edit, if
> there is text in the edit, put the text back into the adjacent hidden
> label and show the label, otherwise delete the label.  Then hide the
> edit box.  Ensure there is always an empty label to click on at the end. 
> 
> Regards, Tony

Hello Tony,

thank you very much for the input on this!
As I mentioned to Federico, the layout itself can obviously be
interchanged, though I agree that a flow-layout makes more sense. I
actually sent the same link you sent me to Federico as a response - I
might have forgotten to CC it to the mailing list though.

I find your approach interesting, though it's not quite what I wanted.
It does roughly the same thing, though the semantics are different, as
the labels themselves are treated less like text and more like separate
interactable widgets. Not to say that's a bad thing, I've opted for a
different approach for the UX question at hand for now anyway, but it
still doesn't sit right with me that I was unable to find a solution for
the exact problem, given how prominent of a solution it is for web
development.

Sincerely,
Jonathan


More information about the Interest mailing list