Solved Render QListView like QTableView
I dont really know how to call what i want. And because of that, i wasn't able to search for it properly.
I've got a simple list-model and i'm rendering it in a QListview. And that works fine. But is there a way to render a QListView like a Table?
Lets take 3 columns for example. That should look like that. (the number is the id from that data in the model)
How it looks like normaly:
How i want it to look like:
  
  
Ich hope you know what I mean?
Hi and welcome
Have a look at the flow setting
Setting it to LeftToRight might do what you want :)
Also set isWrapping to true
Also look at gridsize.
dada last edited by
Nope, doesn't work. It changes it from:
     .....
Howerver, if there's no easy way i'll use a QTableView and change the data-method in the model to act like an table but with an 1D array. Like that: (I use Qt only in Python, so i'm showing you python)
return data[(row - 1) * 3 + column]
I think that should work
But thank you anyway
well it will wrap at widgets border
so if u need it to wrap before, u might try icon mode/grid mode.
Well using QTableView does seems like a better fit then.
Thank you! That works great. :D
The Tableview would have worked too. But there's the problem, the view expects, that every row has the same amount of columns... There would it be a litle tricky (x) :
  
Oh you need something like
  
  [x]
[x]is empty ?
Nope. I need what you postet^^
But before your post, i tried to archive my goal with an QTableView. But there occured some issues when your datamodel hasn't enaugh items to fill the last row completly. You know what i mean?
But it doesnt care anymore. Your solution works fine.