Hello folks,

 

         When I upgrade from Qt 4.5 tp1 to Qt 4.5 beta. Some codes using
QSqlTableModel failed when calling submitAll().

         The environment is: Linux/CensOS 5, MySQL 5.1.30. The codes example
is as following, I wonder it is a bug or I have missed something.

 

QSqlTableModel planTab( 0, *m_pSqlDB );

        planTab.setEditStrategy( QSqlTableModel::OnManualSubmit );

        planTab.setTable( strTab.c_str() );

        tm_st_pg_t::const_iterator iterTm

                = thePlan.begin();

        while( iterTm != thePlan.end() ){

                const string tm = iterTm->first;

                st_pg_t::const_iterator iterST

                        = iterTm->second.begin();

                while( iterST != iterTm->second.end() ){

                        const string st = iterST->first;

                        const double pg = iterST->second;

                        QSqlRecord theRec = planTab.record();

                        theRec.setValue( "tm",  QString::fromLocal8Bit(
tm.c_str() ) );

                        theRec.setValue( "st",  QString::fromLocal8Bit(
st.c_str() ));

                        theRec.setValue( "pg",  QString::number( pg ) );

                        planTab.insertRecord( -1, theRec );

                        ++iterST;

                }

                ++iterTm;

        }

        planTab.submitAll();

_______________________________________________
Qt4-preview-feedback mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt4-preview-feedback

Reply via email to