[Qt-interest] QTableWidget not showing QTableWidgetItems

Andrei Sebastian Cimpean andreiamenta at gmail.com
Thu Sep 24 12:41:06 CEST 2009


On Thursday 24 September 2009 01:18:11 pm you wrote:
> I am not sure,  you need to set columncount()
> 
> 
> Thanks
> 
> Yuvaraj R
> On Thu, Sep 24, 2009 at 3:37 PM, Andrei Sebastian Cimpean <
> 
> andreiamenta at gmail.com> wrote:
> > Hello everybody!
> > I have this code that i put together using tutorials from Qt. I send a
> > QStringList as parameter and in debug mode it shows correctly
> > everything... The this is that the result i get is something like this:
> >
> > http://img22.imageshack.us/content.php?page=done&l=img22/4738/snapshot3tf
> >.png Can anyone help me? Thanks
> >
> >    QGroupBox *configGroup = new QGroupBox(tr("Files selected for
> > renaming"));
> >    QTableWidget *filesTable = new QTableWidget();
> >    filesTable->setRowCount(1);
> >    qDebug() << files;
> >    for (int i = 0; i < files.size(); ++i){
> >        QTableWidgetItem *fileNameItem = new
> > QTableWidgetItem(files.at(i)); qDebug()<<fileNameItem->text();
> >        fileNameItem->setFlags(Qt::ItemIsUserCheckable);
> >        int row = filesTable->rowCount();
> >        filesTable->insertRow(row);
> >        filesTable->setItem(row, 0,fileNameItem);
> >    }
> >    QVBoxLayout *mainLayout = new QVBoxLayout;
> >    mainLayout->addWidget(filesTable);
> >    mainLayout->addStretch(1);
> >    setLayout(mainLayout);
> >
> > _______________________________________________
> > Qt-interest mailing list
> > Qt-interest at trolltech.com
> > http://lists.trolltech.com/mailman/listinfo/qt-interest
> 
Yes thank you... it seems that i missed setColumnCount . Thank you for the 
swift help. It seems that 4 eyes really are better than two :P
Thanks again.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090924/da031a26/attachment.bin 


More information about the Qt-interest-old mailing list