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.
QtWS25 Last Chance

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
  • 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.
  • brucezcgB Offline
    brucezcgB Offline
    brucezcg
    wrote on last edited by brucezcg
    #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
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on 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.

      brucezcgB 1 Reply Last reply
      1
      • mrjjM mrjj

        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.

        brucezcgB Offline
        brucezcgB Offline
        brucezcg
        wrote on last edited by brucezcg
        #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]
        mrjjM 1 Reply Last reply
        0
        • brucezcgB brucezcg

          @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]
          mrjjM Offline
          mrjjM Offline
          mrjj
          Lifetime Qt Champion
          wrote on last edited by mrjj
          #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 ?

          brucezcgB 1 Reply Last reply
          0
          • mrjjM mrjj

            @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 ?

            brucezcgB Offline
            brucezcgB Offline
            brucezcg
            wrote on 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

            mrjjM 1 Reply Last reply
            0
            • brucezcgB brucezcg

              @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

              mrjjM Offline
              mrjjM Offline
              mrjj
              Lifetime Qt Champion
              wrote on last edited by mrjj
              #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

              • Login

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