Results 1 to 4 of 4

Thread: I'd like to make my own custom view.

  1. #1
    Join Date
    Jul 2012
    Posts
    201
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default I'd like to make my own custom view.

    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. Capture2.jpgCapture.PNGCapture3.png.

  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: I'd like to make my own custom view.

    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,
    _

  3. #3
    Join Date
    Jul 2012
    Posts
    201
    Thanks
    26
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: I'd like to make my own custom view.

    It would be nice if I could use the QListView for this. But thank you for the info on the source code.

  4. #4
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: I'd like to make my own custom view.

    You can use QListView for multi-column display (as in your 3rd picture). Set flow to TopToBottom (the default) and set wrapping to true.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

Similar Threads

  1. Replies: 4
    Last Post: 25th June 2010, 07:28
  2. Custom Model? Custom View? Custom Delegate?
    By Doug Broadwell in forum Newbie
    Replies: 4
    Last Post: 11th February 2010, 20:23
  3. Replies: 1
    Last Post: 1st February 2010, 18:42
  4. Question about custom view (or custom delegate)
    By skuda in forum Qt Programming
    Replies: 1
    Last Post: 21st September 2009, 20:06
  5. Model-view: Creating a custom view
    By taboom in forum Qt Programming
    Replies: 5
    Last Post: 17th August 2007, 20:36

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.