[Interest] [External] Re: Best way to implement a line edit with breaks

Sean Murphy (NSS) Sean.M.Murphy at us.kbr.com
Wed Apr 23 14:29:56 CEST 2025


> On Wed, 23 Apr 2025 at 6:35 Scott Bloom <scott at towel42.com> wrote:
> Over the years this has come up to my a couple of times, and I wanted to get the hive’s opinion
>
> The “easiest” example is the entry for an IP address, but it could be for any string of numbers (or
> letters) where there are sub strings in one larger string
>
> For an IP address, you often see 4 smaller line edits.  But if there are 12 substrings, that becomes
> a pain to handle.
>
> Ideally Im thinking to present it in a similar fashion to the hex side of hex editor.
>
> Where each “grouping” has a space between them, this of course means a custom painter etc etc
>
> Any thoughts? Anyone seen a widget similar to what Im asking for?

My first thought is maybe a QTableView with a custom stylesheet? You could tweak the cell dividers
to both increase the horizontal width of them as well as removing the frame shadows to make it look
more like the hex editor concept without having to worry about the cursor getting into the space between the groupings?

Sean
This e-mail, including any attached files, may contain confidential information, privileged information and/or trade secrets for the sole use of the intended recipient. Any review, use, distribution, or disclosure by others is strictly prohibited. If you are not the intended recipient (or authorized to receive information for the intended recipient), please contact the sender by reply e-mail and delete all copies of this message.


More information about the Interest mailing list