Results 1 to 2 of 2

Thread: currentCharFormatChanged() not reporting List or Table formats

  1. #1
    Join Date
    Mar 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default currentCharFormatChanged() not reporting List or Table formats

    In QTextEdit, when the cursor is moved and the underlying formatting attributes change, the currentCharFormatChanged() signal is emitted to reflect the new attributes at the new cursor position.

    However, this is working only for charformats. How to identify List and Table/TableCell formats?

    Even the TextEdit sample does not have this in the code. As a result, when cursor is put on a list or table text, the tool bars are not getting updated correctly for the format type.

    How to retrieve the List and Table formats ?

    Thank you,
    P.Gopalakrishna
    http://www.CineFxLabs.com

  2. #2
    Join Date
    Mar 2009
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: currentCharFormatChanged() not reporting List or Table formats

    Never Mind.

    Using cursorPositionChanged() got the updates.

    Something like below:

    ------------
    void TextEdit::cursorPositionChanged()
    {
    // Update the Style of text in the ComboBox
    QTextCursor cursor = textEdit->textCursor();
    if (cursor.currentList())
    {
    QTextListFormat listFmt = cursor.currentList()->format();
    this->comboStyle->setCurrentIndex(abs(listFmt.style())); // List Text Type
    }
    else
    this->comboStyle->setCurrentIndex(0); // Standard Text type
    }
    ------------

Similar Threads

  1. Postgresql QSqlRelationalTableModel empty table
    By RolandHughes in forum Qt Programming
    Replies: 0
    Last Post: 12th November 2008, 18:18
  2. Replies: 1
    Last Post: 22nd October 2007, 03:04
  3. Replies: 4
    Last Post: 11th September 2006, 15:13

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
  •  
Qt is a trademark of The Qt Company.