Results 1 to 2 of 2

Thread: Should I develop my own model and view?

  1. #1
    Join Date
    Oct 2006
    Posts
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Should I develop my own model and view?

    Hi, I am trying to develop a table-like view of a data structure. The data structure can be abstracted as:
    Vector<Item>;

    while Item is a composite of several other subitems.
    Item {
    Vector<Item1>;
    Vector<Item2>;
    Vector<Item3>;
    }

    For each subitem, there are different attributes in it.
    Item 1 {
    L1,
    L2,
    L3
    }

    Item 2 {
    X,
    Y,
    Z
    }

    Item 3 {
    u,
    v
    }

    I need display all these Items and subitems and their attributes in a table view, the problem is how the horizontal header of the table should be set.
    I want to use the header to show which attribute, which subitem and which itemType each column is.
    Can someone familiar with the model/view philosophy of QT help me decide if this is a new view or I can still use the QTableView class.

    Thanks a lot!!!

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,364
    Thanks
    3
    Thanked 5,013 Times in 4,791 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: Should I develop my own model and view?

    IMO you can use standard views and for example QStandardItemModel. You can organise it as a tree (items, subitems, attributes) or just as a flat table where subitems occupy columns before items and these are before attributes. I don't exactly know how do you want the headers to look like, if you could for example post an image, it could be easier for us to understand what you require.

Similar Threads

  1. hierarchical model in a flat view
    By gniking in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2009, 21:17
  2. Replies: 9
    Last Post: 7th November 2006, 16:10
  3. Model View Help Please
    By munna in forum Newbie
    Replies: 2
    Last Post: 22nd July 2006, 19:19
  4. Model - View Programming doubt.
    By munna in forum Qt Programming
    Replies: 4
    Last Post: 28th April 2006, 14:01
  5. Replies: 6
    Last Post: 20th April 2006, 11:23

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.