PDA

View Full Version : I'd like to make my own custom view.



ayanda83
28th September 2016, 12:26
Hi there, I would like to make my own custom view (GridView). I know many people would say why not go with the QTableView, and I want to answer that question before I continue. The QTableView records data in the form of records from left to right and the data is related, and that is not what I want to archive. I want to display a bunch of unrelated pdf documents in list format from top to bottom, and the view should be horizontally scrollable (Not Vertical), this means the list must go from one column to the next. I've attached a picture of the main window for my app and the second picture shows how the pdf's will be displayed in the View. The third picture show the ultimate goal I am trying to achieve. Lastly is there a way to view the source code for Qt classes like QListView, I think that can help me successfully create my custom view. 121321213112133.

anda_skoa
28th September 2016, 12:37
Hmm, I am wondering if you can't use a QListView for the visualization as in the second image.

In any case, the code of Qt is available in multiple ways:
- is it part of any Qt download
- the git repositories are public
- there is a web based code browser at http://code.woboq.org

Cheers,
_

ayanda83
28th September 2016, 12:53
It would be nice if I could use the QListView for this. But thank you for the info on the source code.

d_stranz
28th September 2016, 16:02
You can use QListView for multi-column display (as in your 3rd picture). Set flow to TopToBottom (the default) and set wrapping to true.