Results 1 to 6 of 6

Thread: tableView Problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2007
    Posts
    14
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: tableView Problem

    use this...

    Qt Code:
    1. model = new QSqlTableModel(this);
    2. model->setTable(trainingname);//trainingname-name of table to be viewed
    3. model->setEditStrategy(QSqlTableModel::OnManualSubmit);
    4. model->select();
    5.  
    6. model->setHeaderData(0, Qt::Horizontal, tr("CERTIFICATES"));
    7. model->setHeaderData(1, Qt::Horizontal, tr("CERTIFICATE NO."));
    8. model->setHeaderData(2, Qt::Horizontal, tr("TRAINING CENTER"));
    9. model->setHeaderData(3, Qt::Horizontal, tr("DATE"));
    10. model->sort(0, Qt::AscendingOrder);
    11. view = new QTableView;
    12. view->setModel(model);
    To copy to clipboard, switch view to plain text mode 
    Last edited by jpn; 6th February 2008 at 07:39. Reason: missing [code] tags

  2. #2
    Join Date
    Jan 2008
    Posts
    13
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: tableView Problem

    thanks, i finally made it...

Similar Threads

  1. Tricky problem with ARGB widget / UpdateLayeredWindow
    By nooky59 in forum Qt Programming
    Replies: 3
    Last Post: 21st February 2008, 10:35
  2. tableview model view problem
    By skuda in forum Qt Programming
    Replies: 5
    Last Post: 3rd December 2007, 14:02
  3. Replies: 15
    Last Post: 8th May 2007, 11:46
  4. fftw problem
    By lordy in forum General Programming
    Replies: 1
    Last Post: 16th March 2006, 21:36
  5. Replies: 16
    Last Post: 7th March 2006, 15:57

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
  •  
Qt is a trademark of The Qt Company.