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. QTextEdit remove list
Forum Updated to NodeBB v4.3 + New Features

QTextEdit remove list

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 2 Posters 367 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.
  • C Offline
    C Offline
    clarify
    wrote on last edited by
    #1

    I observe in QTextEdit there is a createList method, but what is its opposite?
    Suppose I have a list item like so

    • fubar

    And I want to convert that to a non-list-item paragraph.
    How can I do that?

    JonBJ 1 Reply Last reply
    0
    • C clarify

      @JonB I'm surprised someone hasn't thought to add this feature already.

      Anyway removing and re-adding is what I'm trying now. I'm having some success.

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by
      #4

      @clarify
      Just found https://stackoverflow.com/questions/69812660/how-to-reset-a-bulleted-list-to-normal-text-and-back-in-qtextedit and the Solution from 2021 confirms this approach, and perhaps gives you sample code to check yours against.

      C 2 Replies Last reply
      0
      • C clarify

        I observe in QTextEdit there is a createList method, but what is its opposite?
        Suppose I have a list item like so

        • fubar

        And I want to convert that to a non-list-item paragraph.
        How can I do that?

        JonBJ Offline
        JonBJ Offline
        JonB
        wrote on last edited by JonB
        #2

        @clarify said in QTextEdit remove list:

        I observe in QTextEdit there is a createList method

        There isn't.

        There is for QTextCursor.

        At a guess, you would need to remove the blocks from the list, re-add them outside as plain paragraphs, and then remove the (now) empty list completely.

        C 1 Reply Last reply
        0
        • JonBJ JonB

          @clarify said in QTextEdit remove list:

          I observe in QTextEdit there is a createList method

          There isn't.

          There is for QTextCursor.

          At a guess, you would need to remove the blocks from the list, re-add them outside as plain paragraphs, and then remove the (now) empty list completely.

          C Offline
          C Offline
          clarify
          wrote on last edited by
          #3

          @JonB I'm surprised someone hasn't thought to add this feature already.

          Anyway removing and re-adding is what I'm trying now. I'm having some success.

          JonBJ 1 Reply Last reply
          0
          • C clarify

            @JonB I'm surprised someone hasn't thought to add this feature already.

            Anyway removing and re-adding is what I'm trying now. I'm having some success.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #4

            @clarify
            Just found https://stackoverflow.com/questions/69812660/how-to-reset-a-bulleted-list-to-normal-text-and-back-in-qtextedit and the Solution from 2021 confirms this approach, and perhaps gives you sample code to check yours against.

            C 2 Replies Last reply
            0
            • JonBJ JonB

              @clarify
              Just found https://stackoverflow.com/questions/69812660/how-to-reset-a-bulleted-list-to-normal-text-and-back-in-qtextedit and the Solution from 2021 confirms this approach, and perhaps gives you sample code to check yours against.

              C Offline
              C Offline
              clarify
              wrote on last edited by
              #5
              This post is deleted!
              1 Reply Last reply
              0
              • JonBJ JonB

                @clarify
                Just found https://stackoverflow.com/questions/69812660/how-to-reset-a-bulleted-list-to-normal-text-and-back-in-qtextedit and the Solution from 2021 confirms this approach, and perhaps gives you sample code to check yours against.

                C Offline
                C Offline
                clarify
                wrote on last edited by
                #6

                @JonB
                I can confirm that the approach used on S.O. works.
                Thanks for that.

                1 Reply Last reply
                0
                • C clarify has marked this topic as solved on

                • Login

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