Results 1 to 3 of 3

Thread: Reading info about multiple selected items from a QTableView

  1. #1
    Join Date
    Jul 2009
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Reading info about multiple selected items from a QTableView

    Hello. I am working on an application where i have to list folders and files. I am using a table widget where i list them in rows, while displaying certain info about them in columns.
    I am selecting rows as selection behavior and as selection mode Extended Selection.
    Each time i click an item i can read information about it. But if i press somewhere and move my mouse selecting multiple elements nothing happens. How ca I make it so i can read each of the items in that selection?
    I was thinking of saving the selection in a vector until i make another selection but i cannot read the files under that event. Also i searched for a signal but couldn't find one. Also i thought of using a signal mapper but nothing there.
    Please i could use all the help you can give. If anyone has the time to do a more extended reply i would appreciate it.
    Thank you very much

  2. #2
    Join Date
    Jul 2009
    Location
    Enschede, Netherlands
    Posts
    462
    Thanked 69 Times in 67 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reading info about multiple selected items from a QTableView

    If both views are basically QAbstractItemViews, you might want to have a look at QItemSelectionModel and Handling Selections in Item Views.

  3. #3
    Join Date
    Jul 2009
    Posts
    12
    Thanks
    3
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Reading info about multiple selected items from a QTableView

    The only problem i have is when selecting items with mouse drag. I'm writing into the console the text of the items in the table. When i drag-select items, in the console nothing is printed. i am pretty sure there is a way to read the selected items because it is something that QT implemented as standard with the QTableWidget, but i cannot find that method. If you can point me in the right direction, or explain how this can be achieved i will be greatfull.
    Thank you again.

Similar Threads

  1. Replies: 1
    Last Post: 5th September 2008, 23:54
  2. undo for multiple selected items
    By mooreaa in forum Qt Programming
    Replies: 3
    Last Post: 13th July 2008, 14:13
  3. multiple selection of list view items
    By samirg in forum Qt Programming
    Replies: 2
    Last Post: 30th October 2007, 19:05

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.