Results 1 to 2 of 2

Thread: multiple QListViews on one QAbstractListModel

  1. #1
    Join Date
    Jan 2013
    Posts
    25
    Thanks
    2
    Platforms
    Windows

    Default multiple QListViews on one QAbstractListModel

    Dear all,

    I have one QAbstractListModel and I it in two QListViews in different ways. First QListView is a pop-up and will display only a selection of the items in QAbstractListModel. I hide this view when escape key is pressed. Whereas, second QListView is part of the QMainWindow and will display all items in the QAbstractListModel.

    I am stuck at two points:

    1) How to make selection from QAbstractListModel for the first QListView?
    2) I need to clear the items displayed in second QListView when escape key is pressed for hiding the first QListView.


    any idea how t o do this? Any little help will be appreciated.

  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: multiple QListViews on one QAbstractListModel

    For (1) you could use a QSortFilterProxyModel or use a second model on top of the same data.

    No idea what you mean with (2) though. The second list view should be empty after you close the popup?

    Cheers,
    _

Similar Threads

  1. QAbstractListModel
    By Archa4 in forum Newbie
    Replies: 9
    Last Post: 9th February 2011, 15:43
  2. Problem with QAbstractListModel
    By chandan in forum Newbie
    Replies: 0
    Last Post: 12th April 2010, 01:24
  3. Problem with QAbstractListModel
    By eekhoorn12 in forum Qt Programming
    Replies: 3
    Last Post: 26th August 2009, 15:26
  4. QAbstractListModel searching.
    By ComaWhite in forum Qt Programming
    Replies: 1
    Last Post: 15th June 2009, 19:41
  5. [Qt3] Two QListviews - VerticalScrollBar Sync Problems
    By BrainB0ne in forum Qt Programming
    Replies: 0
    Last Post: 25th September 2008, 12:18

Tags for this Thread

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.