Results 1 to 14 of 14

Thread: QListView not showing all items in the model

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #14
    Join Date
    Aug 2006
    Location
    Madison, WI USA
    Posts
    153
    Thanks
    35
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QListView not showing all items in the model (SOLVED)

    SOLVED!

    My QListView sub-class constructor called setSpacing( 40 ) after calling setGridSize(). While I'm not sure why this upset the normal scrolling of the view, the calls clearly were interfering with each other. Commenting out the setSpacing() call solved the problem.

    Qt Code:
    1. DevLibView::DevLibView( QWidget* pParent ) : QListView( pParent )
    2. {
    3. setViewMode( QListView::IconMode );
    4. setIconSize( QSize( 32, 32 ) );
    5. setGridSize( QSize( 100, 80 ) );
    6. setResizeMode( QListView::Adjust );
    7. setSelectionRectVisible( true );
    8. //setSpacing( 40 );
    9. setFont( QFont( "Tahoma", 8.25 ) );
    10.  
    11. // NOTE: the dragDropMode must be set AFTER the viewMode!!!
    12. setDragEnabled( true );
    13. setDragDropMode( QAbstractItemView::DragOnly );
    14. setSelectionMode( QAbstractItemView::ExtendedSelection );
    15. }
    To copy to clipboard, switch view to plain text mode 
    The view now scrolls as expected (without having to add a layout to my tab widget)!

    Thank you wysota and Gh0str1d3r for your time and suggestions.
    Last edited by mclark; 2nd September 2010 at 21:10. Reason: solved problem

Similar Threads

  1. QBstractTableMode derived model, not showing in QTableView
    By high_flyer in forum Qt Programming
    Replies: 4
    Last Post: 24th March 2010, 15:04
  2. Replies: 4
    Last Post: 7th August 2009, 21:09
  3. designer not showing menu items ...
    By wagmare in forum Installation and Deployment
    Replies: 0
    Last Post: 24th February 2009, 10:26
  4. QListView is not showing contnet
    By hrudhay in forum Qt for Embedded and Mobile
    Replies: 4
    Last Post: 21st August 2008, 07:31
  5. QComboBox not showing all items
    By musikit in forum Qt Programming
    Replies: 3
    Last Post: 10th April 2008, 16:01

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.