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 "reset" indent if I remove a QTextList
Forum Update on Monday, May 27th 2025

How to "reset" indent if I remove a QTextList

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 419 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.
  • R Offline
    R Offline
    Revi
    wrote on last edited by
    #1

    Hello,
    I write at the moment a HTML Editor based on QTextEdit and at the moment I have some problems with a list.
    I create a QTextlist with:

    ui.textEdit->textCursor().createList(QTextListFormat::Style::ListCircle);
    

    I want that only the list format is removed. So that the text looks exactly before I inserted the list.
    I remove the list with:

    ui.textEdit->textCursor().currentList()->remove(ui.textEdit->textCursor().block());
    

    After I did that the list format is correctly removed but the indent is still 1 instead of zero.
    I tried then to manually set the indent to 0 with these functions but it didn't work:

    ui.textEdit->textCursor().blockFormat().setIndent(indent);
    ui.textEdit->textCursor().block().blockFormat().setIndent(indent);
    

    Does anybody has an idea how to correctly change the indent after removing the QTextList.

    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