[Qt-interest] problem filling a QtableWidget

mierdatutis mi mmm286 at gmail.com
Thu May 27 08:00:50 CEST 2010


The item objects are declared before the while
Thanks


2010/5/26 Andre Somers <andre at familiesomers.nl>

> On 26-5-2010 15:10, mierdatutis mi wrote:
> > Hi,
> >
> > I have a problem filling a qtablewidget. Allways fill the first row. I
> > 've checked the code but I dont see any error. Could you help me
> > please? Many thanks and sorry for my english!
> >
> > The code is:
> >
> > ui->tabla->setColumnCount(5);
> >           while ( query4.next() )
> >
> >         {
> >             //QString group = query4.value( 0 ).toString();
> >
> >             item->setText(query4.value(0).toString());
> >             ui->tabla->setItem(a,0,item);
> >             item2->setText(query4.value(1).toString());
> >
> >             ui->tabla->setItem(a,1,item2);
> >             item3->setText(query4.value(2).toString());
> >             ui->tabla->setItem(a,2,item3);
> >             item4->setText(query4.value(3).toString());
> >
> >             ui->tabla->setItem(a,3,item4);
> >
> //QMessageBox::information(this,"",query4.value(3).toString());
> >             item5->setText(query4.value(4).toString());
> >             ui->tabla->setItem(a,4,item5);
> >
> >             a++;
> >         }
> >
>
> Where is a declared and initialized?
>
> André
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20100527/fdd39d65/attachment.html 


More information about the Qt-interest-old mailing list