Results 1 to 4 of 4

Thread: Map QSqlTableModel Column 2 To QListView

  1. #1
    Join Date
    May 2006
    Posts
    19
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Map QSqlTableModel Column 2 To QListView

    Hi All,
    I'm trying to map the second column of data from a QSqlTableModel to a QListView. How would I go about doing this?
    By default it displays the first column of data from the model in the QListView.
    Cheers,
    Donal

  2. #2
    Join Date
    May 2010
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Map QSqlTableModel Column 2 To QListView

    Try using QListView::setModelColumn(int column)

  3. #3
    Join Date
    May 2006
    Posts
    19
    Thanks
    6
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Map QSqlTableModel Column 2 To QListView

    Great, thank you!

  4. #4
    Join Date
    Nov 2023
    Posts
    1

    Default Re: Map QSqlTableModel Column 2 To QListView

    Quote Originally Posted by armonge View Post
    Try using QListView::setModelColumn(int column)
    It really works, Thank you very much.

Similar Threads

  1. Drag & Drop QListView: reorder QSqlTableModel
    By Earthnail in forum Qt Programming
    Replies: 0
    Last Post: 24th March 2010, 18:51
  2. Make a column read-only in a QSqlTableModel/QTableView
    By graciano in forum Qt Programming
    Replies: 0
    Last Post: 15th November 2009, 18:18
  3. Replies: 2
    Last Post: 21st October 2009, 08:13
  4. QSqlTableModel column customization
    By kishore7771 in forum Qt Programming
    Replies: 1
    Last Post: 16th October 2009, 09:07
  5. Sum of a column in QSqlTableModel
    By giusepped in forum Qt Programming
    Replies: 4
    Last Post: 10th November 2008, 23:38

Tags for this Thread

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.