Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to realized the style of Edit Box like this picture shows.
Forum Updated to NodeBB v4.3 + New Features

How to realized the style of Edit Box like this picture shows.

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 2 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    brucezcg
    wrote on 8 May 2018, 01:36 last edited by brucezcg 5 Aug 2018, 02:31
    #1

    0_1525743610451_2018-05-08 09_39_47-Marketch(https___github.com_tudou527) - Internet Explorer.png

    How to realized this style of EditBox.
    Special txt can be auto treated as an block, and can be move or delete just like one charactor.
    Thanks

    1 Reply Last reply
    0
    • M Offline
      M Offline
      mrjj
      Lifetime Qt Champion
      wrote on 8 May 2018, 12:34 last edited by
      #2

      Hi
      so it must contain "boxes" like SOH ?
      also, there will also be editable text ? or just
      a collection of boxes ?
      You could use a list in iconview mode to show it like that if all boxes is same size.

      If you need it with floating/editable text also, i think you need to specify a bit more the needed
      operations on the boxes and the texts then. before i can suggest how you can make it.

      There is TextEdit with images but not sure what boxes can do. if it needs to popup menu and be closable
      as image indicates, it might not work super.

      B 1 Reply Last reply 9 May 2018, 08:28
      1
      • M mrjj
        8 May 2018, 12:34

        Hi
        so it must contain "boxes" like SOH ?
        also, there will also be editable text ? or just
        a collection of boxes ?
        You could use a list in iconview mode to show it like that if all boxes is same size.

        If you need it with floating/editable text also, i think you need to specify a bit more the needed
        operations on the boxes and the texts then. before i can suggest how you can make it.

        There is TextEdit with images but not sure what boxes can do. if it needs to popup menu and be closable
        as image indicates, it might not work super.

        B Offline
        B Offline
        brucezcg
        wrote on 9 May 2018, 08:28 last edited by brucezcg 5 Sept 2018, 08:30
        #3

        @mrjj said in How to realized the style of Edit Box like this picture shows.:

        Hi
        so it must contain "boxes" like SOH ?
        also, there will also be editable text ? or just
        a collection of boxes ?
        You could use a list in iconview mode to show it like that if all boxes is same size.

        If you need it with floating/editable text also, i think you need to specify a bit more the needed
        operations on the boxes and the texts then. before i can suggest how you can make it.

        There is TextEdit with images but not sure what boxes can do. if it needs to popup menu and be closable
        as image indicates, it might not work super.

        Thanks for reply.

        1. There will be many kinds of "boxes" not only SOH, but also have NUL ACK CR LF etc. both of them are invisible characters in ASCII table.
        2. One "box" is treated as one item in the edit box.
        3. "Box" can be delete by click x
        4. "Box" can be moved in edit box as an entirety.
        5. There will be also editable text , just like:
          [SOH]hello[CR]
        M 1 Reply Last reply 9 May 2018, 16:22
        0
        • B brucezcg
          9 May 2018, 08:28

          @mrjj said in How to realized the style of Edit Box like this picture shows.:

          Hi
          so it must contain "boxes" like SOH ?
          also, there will also be editable text ? or just
          a collection of boxes ?
          You could use a list in iconview mode to show it like that if all boxes is same size.

          If you need it with floating/editable text also, i think you need to specify a bit more the needed
          operations on the boxes and the texts then. before i can suggest how you can make it.

          There is TextEdit with images but not sure what boxes can do. if it needs to popup menu and be closable
          as image indicates, it might not work super.

          Thanks for reply.

          1. There will be many kinds of "boxes" not only SOH, but also have NUL ACK CR LF etc. both of them are invisible characters in ASCII table.
          2. One "box" is treated as one item in the edit box.
          3. "Box" can be delete by click x
          4. "Box" can be moved in edit box as an entirety.
          5. There will be also editable text , just like:
            [SOH]hello[CR]
          M Offline
          M Offline
          mrjj
          Lifetime Qt Champion
          wrote on 9 May 2018, 16:22 last edited by mrjj 5 Sept 2018, 16:42
          #4

          @brucezcg
          One option is create a custom object for TextEdit
          http://doc.qt.io/qt-5/qtsvg-richtext-textobject-example.html
          But im not 100% sure you can easy get click events for it.

          Option 2 would be a custom Widget for "Box" and QLabel with
          TextInteractionFlags set to Qt::TextEditable.
          And then something like a box layout to hold them.
          But if you need to be able to drag them around also, it might be a bit clumsy
          removing and inserting into layout.

          do you need rich text formatting like bold etc ?

          B 1 Reply Last reply 10 May 2018, 01:32
          0
          • M mrjj
            9 May 2018, 16:22

            @brucezcg
            One option is create a custom object for TextEdit
            http://doc.qt.io/qt-5/qtsvg-richtext-textobject-example.html
            But im not 100% sure you can easy get click events for it.

            Option 2 would be a custom Widget for "Box" and QLabel with
            TextInteractionFlags set to Qt::TextEditable.
            And then something like a box layout to hold them.
            But if you need to be able to drag them around also, it might be a bit clumsy
            removing and inserting into layout.

            do you need rich text formatting like bold etc ?

            B Offline
            B Offline
            brucezcg
            wrote on 10 May 2018, 01:32 last edited by
            #5

            @mrjj said in How to realized the style of Edit Box like this picture shows.:

            @brucezcg
            One option is create a custom object for TextEdit
            http://doc.qt.io/qt-5/qtsvg-richtext-textobject-example.html
            But im not 100% sure you can easy get click events for it.

            Option 2 would be a custom Widget for "Box" and QLabel with
            TextInteractionFlags set to Qt::TextEditable.
            And then something like a box layout to hold them.
            But if you need to be able to drag them around also, it might be a bit clumsy
            removing and inserting into layout.

            do you need rich text formatting like bold etc ?

            Thanks, I don't need need to format the text.
            As you say, this is big effort to realize what I want

            M 1 Reply Last reply 10 May 2018, 07:06
            0
            • B brucezcg
              10 May 2018, 01:32

              @mrjj said in How to realized the style of Edit Box like this picture shows.:

              @brucezcg
              One option is create a custom object for TextEdit
              http://doc.qt.io/qt-5/qtsvg-richtext-textobject-example.html
              But im not 100% sure you can easy get click events for it.

              Option 2 would be a custom Widget for "Box" and QLabel with
              TextInteractionFlags set to Qt::TextEditable.
              And then something like a box layout to hold them.
              But if you need to be able to drag them around also, it might be a bit clumsy
              removing and inserting into layout.

              do you need rich text formatting like bold etc ?

              Thanks, I don't need need to format the text.
              As you say, this is big effort to realize what I want

              M Offline
              M Offline
              mrjj
              Lifetime Qt Champion
              wrote on 10 May 2018, 07:06 last edited by mrjj 5 Oct 2018, 07:09
              #6

              @brucezcg
              Yes, its not trivial to create due to mixed box feature and editable text.
              Especially the drag around part.
              I think the textobject way will work the best.
              It can even drag the object but it seems to vanish bt i assume its fixable :)

              1 Reply Last reply
              0

              6/6

              10 May 2018, 07:06

              • Login

              • Login or register to search.
              6 out of 6
              • First post
                6/6
                Last post
              0
              • Categories
              • Recent
              • Tags
              • Popular
              • Users
              • Groups
              • Search
              • Get Qt Extensions
              • Unsolved