Qt-interest Archive, April 2007
QSqlQueryModel Problem
Message 1 in thread
Hi,I am developing an application with database Firebird. Necessary to
place in one tableView all the data of a table, for this I am writing
the following code: ... QSqlQueryModel *model = new QSqlQueryModel; model->setQuery("SELECT * FROM UNIDADE_MEDIDA ORDER BY UNIDADE_MEDIDA"); model->setHeaderData(0, Qt::Horizontal, tr("Unidade")); model->setHeaderData(1, Qt::Horizontal, tr("Descrição")); model->setHeaderData(2, Qt::Horizontal, tr("Decimais")); while(model->canFetchMore( )) model->fetchMore( ); ui.tableView_Unidades->setModel(model); ui.tableView_Unidades->verticalHeader( )->hide( );...However, just one row (line) is only placed in tableView. What
it is happening?Thanks,Marcelo E. GeyerStandard Net Tecnologia - Brazil
_________________________________________________________________
O Windows Live Spaces já chegou! É fácil criar o seu próprio Web site pessoal.
http://spaces.live.com/signup.aspx
Message 2 in thread
Marcelo Estanislau Geyer wrote:
> I am developing an application with database Firebird. Necessary to
> place in one tableView all the data of a table, for this I am writing
> the following code:
>
> ...
> QSqlQueryModel *model = new QSqlQueryModel;
> model->setQuery("SELECT * FROM UNIDADE_MEDIDA ORDER BY UNIDADE_MEDIDA");
>
> model->setHeaderData(0, Qt::Horizontal, tr("Unidade"));
> model->setHeaderData(1, Qt::Horizontal, tr("Descrição"));
> model->setHeaderData(2, Qt::Horizontal, tr("Decimais"));
>
> while(model->canFetchMore( ))
> model->fetchMore( );
>
> ui.tableView_Unidades->setModel(model);
> ui.tableView_Unidades->verticalHeader( )->hide( );
> ...
>
> However, just one row (line) is only placed in tableView. What it is
> happening?
>
Which version of Firebird and Qt are you using?
How many rows does the query return if you run it in isql or Qt SQL Browser?
--
[ signature omitted ]
Message 3 in thread
Anders,In the QT happens accurately equal (just one row), however in isql it
returns all the information. It will be that bug in the QT?
Somebody could make the test using QT SQL Browser?Thanks to advanced!Marcelo E. GeyerStandard Net Tecnologia - Brazil> From: alarsen@xxxxxxxxxxxxx> Subject: Re: QSqlQueryModel Problem> Date: Wed, 25 Apr 2007 10:13:53 +0200> To: qt-interest@xxxxxxxxxxxxx> > Marcelo Estanislau Geyer wrote:> > > I am developing an application with database Firebird. Necessary to > > place in one tableView all the data of a table, for this I am writing > > the following code:> > > > ...> > QSqlQueryModel *model = new QSqlQueryModel;> > model->setQuery("SELECT * FROM UNIDADE_MEDIDA ORDER BY UNIDADE_MEDIDA");> > > > model->setHeaderData(0, Qt::Horizontal, tr("Unidade"));> > model->setHeaderData(1, Qt::Horizontal, tr("Descrição"));> > model->setHeaderData(2, Qt::Horizontal, tr("Decimais"));> > > > while(model->canFetchMore( ))> > model->fetchMore( );> > > > ui.tableView_Unidades->setModel(model);> > ui.tableView_Unidades->verticalHeader( )->hide( );> > ...> > > > However, just one row (line) is only placed in tableView. What it is > > happening?> > > > Which version of Firebird and Qt are you using?> > How many rows does the query return if you run it in isql or Qt SQL Browser?> > > --> Anders L.> > --> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.> List archive and information: http://lists.trolltech.com/qt-interest/>
_________________________________________________________________
O Windows Live Spaces já chegou! É fácil criar o seu próprio Web site pessoal.
http://spaces.live.com/signup.aspx
Message 4 in thread
Hi,I'm using Firebird 1.5 and QT 4.3 beta, SO Microsoft Windows XP.In the QT SQL Browser happens accurately equal (just one row), however in isql it
returns all the information. It will be that bug in the QT?
Somebody could make the test using QT SQL Browser?Thanks to advanced!Marcelo E. Geyer - Brazil> From: alarsen@xxxxxxxxxxxxx> Subject: Re: QSqlQueryModel Problem> Date: Wed, 25 Apr 2007 10:13:53 +0200> To: qt-interest@xxxxxxxxxxxxx> > Marcelo Estanislau Geyer wrote:> > > I am developing an application with database Firebird. Necessary to > > place in one tableView all the data of a table, for this I am writing > > the following code:> > > > ...> > QSqlQueryModel *model = new QSqlQueryModel;> > model->setQuery("SELECT * FROM UNIDADE_MEDIDA ORDER BY UNIDADE_MEDIDA");> > > > model->setHeaderData(0, Qt::Horizontal, tr("Unidade"));> > model->setHeaderData(1, Qt::Horizontal, tr("Descrição"));> > model->setHeaderData(2, Qt::Horizontal, tr("Decimais"));> > > > while(model->canFetchMore( ))> > model->fetchMore( );> > > > ui.tableView_Unidades->setModel(model);> > ui.tableView_Unidades->verticalHeader( )->hide( );> > ...> > > > However, just one row (line) is only placed in tableView. What it is > > happening?> > > > Which version of Firebird and Qt are you using?> > How many rows does the query return if you run it in isql or Qt SQL Browser?> > > --> Anders L.> > --> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.> List archive and information: http://lists.trolltech.com/qt-interest/>
_________________________________________________________________
Ligue para os amigos com a Chamada de PC para PC - GRATUITO
http://get.live.com/messenger/overview
Message 5 in thread
Hi,Resolved the problem. Collate for tables in the database was not
defined, being that it would have to be ISO_8859_1. As the table
possessed registers with accents (iso8859-), it returned one row in tableView.Thanks again,Marcelo Geyer.From: estanisgeyer@xxxxxxxxxxxxx: alarsen@xxxxxxxxxxxxx; qt-interest@xxxxxxxxxxxxxxxxxxxx: RE: QSqlQueryModel ProblemDate: Thu, 26 Apr 2007 03:26:42 +0000
Hi,I'm using Firebird 1.5 and QT 4.3 beta, SO Microsoft Windows XP.In the QT SQL Browser happens accurately equal (just one row), however in isql it
returns all the information. It will be that bug in the QT?
Somebody could make the test using QT SQL Browser?Thanks to advanced!Marcelo E. Geyer - Brazil> From: alarsen@xxxxxxxxxxxxx> Subject: Re: QSqlQueryModel Problem> Date: Wed, 25 Apr 2007 10:13:53 +0200> To: qt-interest@xxxxxxxxxxxxx> > Marcelo Estanislau Geyer wrote:> > > I am developing an application with database Firebird. Necessary to > > place in one tableView all the data of a table, for this I am writing > > the following code:> > > > ...> > QSqlQueryModel *model = new QSqlQueryModel;> > model->setQuery("SELECT * FROM UNIDADE_MEDIDA ORDER BY UNIDADE_MEDIDA");> > > > model->setHeaderData(0, Qt::Horizontal, tr("Unidade"));> > model->setHeaderData(1, Qt::Horizontal, tr("Descrição"));> > model->setHeaderData(2, Qt::Horizontal, tr("Decimais"));> > > > while(model->canFetchMore( ))> > model->fetchMore( );> > > > ui.tableView_Unidades->setModel(model);> > ui.tableView_Unidades->verticalHeader( )->hide( );> > ...> > > > However, just one row (line) is only placed in tableView. What it is > > happening?> > > > Which version of Firebird and Qt are you using?> > How many rows does the query return if you run it in isql or Qt SQL Browser?> > > --> Anders L.> > --> To unsubscribe - send a mail to qt-interest-request@xxxxxxxxxxxxx with "unsubscribe" in the subject or the body.> List archive and information: http://lists.trolltech.com/qt-interest/> Ligue para os amigos com a Chamada de PC para PC - GRATUITO Experimente já!
_________________________________________________________________
O Windows Live Spaces já chegou! É fácil criar o seu próprio Web site pessoal.
http://spaces.live.com/signup.aspx