PDA

View Full Version : Problem in QTableWidget::columnSpan()



mah_singh1
16th January 2009, 08:33
Hi,

I am working on Qt 4.4.0 release. There seems to be a problem in the QTableWidget::columnSpan() method.



QTableWidget *tableWidget = new QTableWidget();
tableWidget->setColumnCount(5);
tableWidget->setRowCount(6);
QTableWidgetItem *aItem = new QTableWidgetItem("Test");
for(int i=0;i<6;i++)
{
for(int j=0;j<5;j++)
{
tableWidget->setItem(i, j, aItem );
}
}
tableWidget->setSpan(1,2,1,2);
tableWidget->setSpan(2,3,1,2);

int aSpan = tableWidget->columnSpan(1,2);
aSpan = tableWidget->columnSpan(2,3); :( aSpan is set to 1, which is incorrect.



Can somebody help me..

Thanks,
Mahesh

jpn
16th January 2009, 15:46
Update to a more recent version of Qt. It returns 2 at least with Qt 4.5.0-beta1.

PS. It makes no sense to set the same item to multiple cells.

mah_singh1
18th January 2009, 04:51
Thanks a lot for the answer. I will upgrade to the latest Qt version.