Results 1 to 4 of 4

Thread: how can I refresh QSqlQueryModel?

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jun 2009
    Posts
    74
    Thanks
    23
    Thanked 2 Times in 2 Posts

    Question how can I refresh QSqlQueryModel?

    Hi,All

    I'am using QSqlQueryModel ,but I am wondering how can I refresh the data inside it,
    for example:
    //
    Qt Code:
    1. model->setQuery("SELECT name, salary FROM employee");
    2. model->setHeaderData(0, Qt::Horizontal, tr("Name"));
    3. model->setHeaderData(1, Qt::Horizontal, tr("Salary"));
    4.  
    5. QTableView *view = new QTableView;
    6. view->setModel(model);
    7. view->show();
    To copy to clipboard, switch view to plain text mode 
    //
    if I insert a row into employee using another application,
    how can i refresh the QSqlQueryModel?

    Thanks.
    Last edited by wysota; 15th June 2009 at 17:23. Reason: missing [code] tags

Similar Threads

  1. Can't seem to get QGraphicsView to refresh
    By smahnken in forum Qt Programming
    Replies: 18
    Last Post: 29th August 2008, 08:32
  2. QSqlQueryModel fetchMore
    By skuda in forum Qt Programming
    Replies: 0
    Last Post: 17th July 2008, 19:42
  3. QSqlQueryModel speed problem
    By tbscope in forum Qt Programming
    Replies: 2
    Last Post: 23rd March 2008, 11:31
  4. Refresh QDataTable
    By shamik in forum Qt Programming
    Replies: 25
    Last Post: 1st December 2006, 05:04
  5. QSqlQueryModel + set Write
    By raphaelf in forum Qt Programming
    Replies: 7
    Last Post: 5th June 2006, 08:55

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.