Results 1 to 2 of 2

Thread: Slow refresh QsqlQueryModel with QTableView

  1. #1
    Join Date
    Feb 2012
    Posts
    5
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Slow refresh QsqlQueryModel with QTableView

    First of all, i am brazilian therefore my english is not verry good.

    I have a QTableView using QSqlQueryModel in a search screen and my table contains more than 30,000 records. I created a function to update my table. But every time I open the search screen I need to upgrade I wonder how to solve the problem! Help me please!

    The code to update my table:

    QString strTemp;

    m_ModelProduct->clear();

    m_ModelProduct->setQuery(SQL_LOCAL_PRODUCTS);

    while( m_ModelProduct->canFetchMore())
    {
    m_ModelProduct->fetchMore();

    strTemp.sprintf(" Produtos ( Processando... ) ");

    m_ui->groupBoxMedicamentos->setTitle(strTemp);
    }


    m_ui->tableViewSearch->setModel( m_ModelProduct);

    SetHeaderTables();

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,420
    Thanks
    37
    Thanked 1,545 Times in 1,495 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Slow refresh QsqlQueryModel with QTableView

    Why the loop?

    The update method would not need to do anything other than to set the query on the model, no?

    Also you have not indicated what the problem is that you are trying to solve.

    Cheers,
    _

Similar Threads

  1. Replies: 7
    Last Post: 3rd April 2013, 18:53
  2. Replies: 1
    Last Post: 25th August 2009, 13:26
  3. how can I refresh QSqlQueryModel?
    By hashb in forum Qt Programming
    Replies: 3
    Last Post: 20th June 2009, 03:39
  4. [model/view] slow refresh on big table
    By lauranger in forum Qt Programming
    Replies: 4
    Last Post: 3rd March 2008, 21:40
  5. QTableView refresh
    By eleanor in forum Qt Programming
    Replies: 9
    Last Post: 6th October 2007, 18:00

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.