PDA

View Full Version : how to access QCheckTableItem data with in a QTable.



ashukla
14th September 2007, 13:22
Dear Everyone!
I have putted a QTable at design time & putted file in zeroth column using with QCheckTableItem.
How to access QCheckTableItem when it is checked using setCheced()?
What is the syntax in this case to put this data into Table2.
void dlgCreateplayist::init()
{

int row=0; //row no.
int i=0;
int x=1; //seqence no.

QString string;
QDir dirp("/root/");
QStringList list=dirp.entryList("*.h;*.c;*.cpp");

for(QStringList::Iterator it=list.begin();it!=list.end();++it)

{
Table1->insertRows(row);
Table1->setColumnWidth(0,150);
Table1->setColumnWidth(1,35);

Table1->setRowLabels(" ");

Table1->setText(row,1,QString::number(x));

Table1->setText(row,2,*it);

QString data(*it);
QString s = data.section(".",1,1);

Table1->setText(row,3,s);

string = "/root/";

b[i] =string.append( *it);

Table1->setText(row,4,b[i]);


QString num=QString::number(row);


Table1->setItem(row,0,new QCheckTableItem(Table1,*it));

a[i] = *it;

i++;
row++;
x++;

}
p= Table1->numRows();

}

Thanks in advance!
regards!

jpn
15th September 2007, 11:55
Perhaps QTable::valueChanged(int row, int col) gets emitted?