Results 1 to 4 of 4

Thread: Qt4.4 QListView paragraph

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2007
    Location
    Paris
    Posts
    459
    Thanks
    98
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4 Qt5

    Default Qt4.4 QListView paragraph

    Hey there,

    I'm using a QListView to display a list of QTextDocument based paragraphs.

    Everytime I resize my view I have to call : QAbstractListModel::reset(), to update the paragraph's geometry.

    here is my paint delegate content :
    Qt Code:
    1. painter->save();
    2.  
    3. QTextDocument document;
    4. document.setHtml(mText);
    5. document.setPageSize(QSize(rect.width(), rect.height()));
    6.  
    7. QAbstractTextDocumentLayout::PaintContext context;
    8. painter->translate(rect.x(), rect.y());
    9. document.documentLayout()->draw(painter, context);
    10.  
    11. painter->restore();
    To copy to clipboard, switch view to plain text mode 

    When resizing my widgets : the view goes blank, until resize is completed.
    Is there a way to avoid this ?
    Last edited by bunjee; 12th May 2008 at 16:40.

Similar Threads

  1. Replies: 2
    Last Post: 8th April 2008, 10:35
  2. QListView word wrap
    By serega in forum Qt Programming
    Replies: 17
    Last Post: 30th August 2007, 03:13
  3. QDialog / QListView problem
    By harakiri in forum Qt Programming
    Replies: 1
    Last Post: 10th July 2007, 18:31
  4. Subclass QListView to show two colums in one
    By Mookie in forum Qt Programming
    Replies: 2
    Last Post: 23rd June 2007, 02:12
  5. Keeping focus at bottom of QListView
    By jakamph in forum Qt Programming
    Replies: 4
    Last Post: 10th January 2006, 14:45

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.