Results 1 to 4 of 4

Thread: QTextList signals and slots

  1. #1
    Join Date
    May 2015
    Posts
    21
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default QTextList signals and slots

    How can I capture events when text blocks are added and removed from QTextList. There seams to be no signals for these events???

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTextList signals and slots

    Since it is a QObject subclass, have you checked childEvent()?

    Cheers,
    _

  3. #3
    Join Date
    May 2015
    Posts
    21
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: QTextList signals and slots

    Yes, but from documentation right way to create list is to use QTextCursor. I can not tell QTextCursor to use reimplemented QTextList class where I would do my stuff ??? QTextList constructor is not mentioned in documentation.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QTextList signals and slots

    See my reply to your other post.

    I think you are confused about the architecture of QTextDocument and its helper classes. QTextDocument is not a document editor, it is a specification for how to organize and display text and other information in a format that allows the document to be rendered in a variety of ways.

    Your application is responsible for creating and modifying the document, as well as for maintaining the information to be represented visually by the document. The document doesn't tell you what's been added to it, you tell the document to add something to it. Once you have done that, the QTextCursor provides a way to traverse the document and retrieve or modify the content. But at the core, QTextDocument is simply a way to store and format information to be displayed in a QTextEdit. The signals provided by QTextDocument are there to notify the QTextEdit that the view needs to be refreshed, and QTextEdit takes responsibility for traversing the the document (using QTextCursor) and formatting the information for display.

Similar Threads

  1. Replies: 2
    Last Post: 18th April 2013, 13:15
  2. Signals and Slots
    By ggdev001 in forum Qt Programming
    Replies: 6
    Last Post: 20th February 2013, 13:07
  3. QT SIGNALS and SLOTS
    By beginQT in forum Newbie
    Replies: 7
    Last Post: 23rd September 2011, 15:40
  4. Help with Signals and slots
    By chetu1984 in forum Newbie
    Replies: 5
    Last Post: 10th March 2011, 23:30
  5. Signals and Slots
    By Maluko_Da_Tola in forum Newbie
    Replies: 3
    Last Post: 30th July 2010, 00:57

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.