You are not logged in.

Dear visitor, welcome to QtForum.org. If this is your first visit here, please read the Help. It explains in detail how this page works. To use all features of this page, you should consider registering. Please use the registration form, to register here or read more information about the registration process. If you are already registered, please login here.

steinachim

Beginner

  • "steinachim" is male
  • "steinachim" started this thread

Posts: 5

Location: Darmstadt, Germany

Occupation: studying computer science

  • Send private message

1

Monday, May 3rd 2010, 2:31pm

Problems with QTableView selectionModel

Hello everyone,

I'm feeling rather stupid right now ?( : I use a QTableView to display some data and it works quite nicely, but I want the selection to work like the Windows Explorer's when showing the files in icon mode, i.e. if you select an item in the middle of a row and another somewhere below while pressing the shift-key, not only the item's directly between them are selected, but all the rows in between as well. Somehow I have absolutely no idea where to start (tried subclassing QItemSelectionModel but didn't get any working results...).

Any idea, where to start?
Thanks!

Achim

Junior

Professional

  • "Junior" is male

Posts: 1,622

Location: San Antonio, TX USA

Occupation: Senior Secure Systems Engineer

  • Send private message

2

Monday, May 3rd 2010, 3:10pm

tableView->setSelectionMode( QAbstractItemView::ExtendedSelection );

steinachim

Beginner

  • "steinachim" is male
  • "steinachim" started this thread

Posts: 5

Location: Darmstadt, Germany

Occupation: studying computer science

  • Send private message

3

Tuesday, May 4th 2010, 11:31am

not quite: using the ExtendedSelection gives me the following behaviour (1st click on B3, 2nd on B6 while holding shift):



What I'm looking for is the following:


Or did I overlook something obvious?

Achim

steinachim

Beginner

  • "steinachim" is male
  • "steinachim" started this thread

Posts: 5

Location: Darmstadt, Germany

Occupation: studying computer science

  • Send private message

4

Wednesday, May 5th 2010, 1:12pm

Finally got it!Found out, a QListView in IconMode does exactly what I'm looking for (and even more) :)
Just didn't think it could give me that functionality ^^

Greetz,
Achim