Results 1 to 5 of 5

Thread: insertion of multiple items in a single row

  1. #1
    Join Date
    Oct 2006
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question insertion of multiple items in a single row

    Hello all.

    I having trouble to find a decent way to handle insertions of items.
    I´m using a QTableView and a QStandardItemModel. My aim is to insert an icon and two strings inside one single cell .
    I would like to arrange them like a list with the icon at top and the two strings under.
    What would be the best solution to this?
    Is it possible to insert a QListView inside a cell and fill that view with a QList?
    perhaps not with something standard as QStandardItemModel .

    I tried with itemDelegate and added a widget with some labels but with no luck otherwise this should do the trick I guess.

    Another option that comes to mind is to somehow make like 3 rows inside this cell and setData to each row but it generates some other problems with index if it´s even possible.

    thanks..

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

    Default Re: insertion of multiple items in a single row

    Take a look at QAbstractItemView::setIndexWidget() just remember it is not really suitable for data that gets modified. For those you should reimplement the delegate.

  3. #3
    Join Date
    Oct 2006
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: insertion of multiple items in a single row

    Ok I´ll take a look at it and I have no data who needs to be modified because I just want to display it once in the cell and that´s it.

    thanks..

  4. #4
    Join Date
    Oct 2006
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Thumbs up Re: insertion of multiple items in a single row

    It worked out just fine. Since I use QTableView as table view and itself inherits QAbstractitem I could use setIndexWidget with my QTableVIew. When that thing solved I was able to insert QPixmap and some other strings. Again thanks a lot.

  5. #5
    Join Date
    Nov 2006
    Posts
    2
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: insertion of multiple items in a single row

    Can you post your code for how you used setIndexWidget? I'm having the hardest time figuring out where and how to use it?

    Thanks so much.

    -Kevin-

Similar Threads

  1. QTableWidget's rows deletion and again insertion
    By darpan in forum Qt Programming
    Replies: 1
    Last Post: 17th October 2006, 18:30
  2. Replies: 11
    Last Post: 7th July 2006, 13:09
  3. Selective highlighting of Items
    By Kapil in forum Qt Programming
    Replies: 3
    Last Post: 26th May 2006, 12:20
  4. how to corss compile for windows in Linux
    By safknw in forum Qt Programming
    Replies: 24
    Last Post: 13th May 2006, 05:23
  5. Multiple insertion using QSqlTableModel
    By munna in forum Newbie
    Replies: 3
    Last Post: 9th May 2006, 20:20

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.