Results 1 to 5 of 5

Thread: QAbstractItemView - visualRect never called, nothing painted

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Apr 2009
    Posts
    7
    Thanks
    1
    Qt products
    Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default QAbstractItemView - visualRect never called, nothing painted

    Hi - I have subclassed QAbstractItemView, but my implementation of the visualRect() method never gets called (and nothing ever gets painted). To ensure that the model is not empty, I overrode the setRootIndex, and I simply output the number of items in the model after calling the base class's implementation.

    So, when setRootIndex gets called, I see that my model contains 23 items. Here's the code that tells me so:

    Qt Code:
    1. void GalleryView::setRootIndex (QModelIndex rootIndex)
    2. {
    3. QAbstractItemView::setRootIndex(rootIndex);
    4.  
    5. qDebug () << "there are" << model()->rowCount(rootIndex) << "items to view";
    6. }
    To copy to clipboard, switch view to plain text mode 

    I do not understand why the base class (QAbstractItemView) does not begin calling my visualRect() function as it tries to lay out the 23 items in my model... any help would be appreciated! (Code attached)

    // thanks // greg //
    Attached Files Attached Files

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.