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 329 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 3 May 2023, 00:29 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?

    J 1 Reply Last reply 3 May 2023, 08:02
    0
    • C clarify
      3 May 2023, 14:05

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

      J Offline
      J Offline
      JonB
      wrote on 3 May 2023, 14:10 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 3 May 2023, 14:55
      0
      • C clarify
        3 May 2023, 00:29

        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?

        J Offline
        J Offline
        JonB
        wrote on 3 May 2023, 08:02 last edited by JonB 5 Mar 2023, 08:02
        #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 3 May 2023, 14:05
        0
        • J JonB
          3 May 2023, 08:02

          @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 3 May 2023, 14:05 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.

          J 1 Reply Last reply 3 May 2023, 14:10
          0
          • C clarify
            3 May 2023, 14:05

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

            J Offline
            J Offline
            JonB
            wrote on 3 May 2023, 14:10 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 3 May 2023, 14:55
            0
            • J JonB
              3 May 2023, 14:10

              @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 3 May 2023, 14:55 last edited by
              #5
              This post is deleted!
              1 Reply Last reply
              0
              • J JonB
                3 May 2023, 14:10

                @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 3 May 2023, 15:45 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 3 May 2023, 15:45

                1/6

                3 May 2023, 00:29

                • Login

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