Results 1 to 2 of 2

Thread: row QDataTable

  1. #1
    Join Date
    Sep 2006
    Posts
    42
    Thanks
    2
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11

    Angry row QDataTable

    Hello,

    The QDataTable only brings update the value of the first row, the others not.

    I am trying this:

    /********************************************/
    register int i = dataTable->currentRow();
    if ( i == -1 ) i = 0;

    //QSqlRecord *getCurrentItemIdViatura = dataTable->currentRecord();

    else if(i = 1)
    {
    QVariant getCurrentItemIdOcorrencia;
    getCurrentItemIdOcorrencia = dataTable->value(0,0);

    QString data = dataTable->text(2,2);

    QSqlQuery queryUpdateChegada;
    queryUpdateChegada.prepare( QUERY_GO_ARRIVEDOCCURRENCE "id_ocorrencia= :id_ocorrencia AND id_viatura= :id_viatura "
    "AND id_cidade= :id_cidade ;" );

    queryUpdateChegada.bindValue( ":id_ocorrencia", getCurrentItemIdOcorrencia );
    queryUpdateChegada.bindValue( ":id_viatura", data );

    queryUpdateChegada.bindValue( ":id_cidade", 8105);

    if (queryUpdateChegada.exec())
    {}
    }

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: row QDataTable

    Quote Originally Posted by cristiano View Post
    getCurrentItemIdOcorrencia = dataTable->value(0,0);
    It looks like you always take the item id from the first row.

Similar Threads

  1. QDataTable Inserts and Updates
    By ederbs in forum Qt Programming
    Replies: 2
    Last Post: 26th October 2006, 23:23
  2. Signal QDataTable
    By cristiano in forum Qt Programming
    Replies: 3
    Last Post: 17th October 2006, 06:28
  3. QDataTable with two tables
    By cristiano in forum Qt Tools
    Replies: 1
    Last Post: 14th September 2006, 17:26
  4. displaying any table on a qdatatable
    By Philip_Anselmo in forum Newbie
    Replies: 4
    Last Post: 9th May 2006, 22:12
  5. Refreshing QDataTable
    By zlatko in forum Qt Programming
    Replies: 5
    Last Post: 2nd May 2006, 16:11

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.