Hi,
Sorry I think I am confusing myself and others. This is what I am doing.
I am loading values to the list box from the table in the first place.
The Table is in the main window and the list box is residing in another dialog box.
So to send data I am using the following code segment.
b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
To copy to clipboard, switch view to plain text mode
where
b is object to the dialog that holds the list box,
ChoosenParam_lb is the name of the dialog
and Table1 is the name of the Table.
The test statement and output are as follows
This is given immediately after this code
s=b->ChoosenParam_lb->currentText();//Test
printf("Choosen Param : %s\n",s);//Test
s=b->ChoosenParam_lb->currentText();//Test
printf("Choosen Param : %s\n",s);//Test
To copy to clipboard, switch view to plain text mode
O/P:- (null);
The Whole Code is For loading the values is given below
//Insert Items From Table to List Box Which is in Parameter Selection Dialog
const char *s;
if (size1 >18)
{
a = size1-18;
for (i=0; i<18; i++)
{
b->ChoosenParam_lb->setCurrentItem(i); //Test
b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
s=b->ChoosenParam_lb->currentText();//Test
printf("Choosen Param : %s\n",s);//Test
}
}
else
{
for (i=0; i<size1; i++)
{
b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
}
}
if ( a!=0)
{
for (i=0; i<a; i++)
{
b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
}
}
//Insert Items From Table to List Box Which is in Parameter Selection Dialog
const char *s;
if (size1 >18)
{
a = size1-18;
for (i=0; i<18; i++)
{
b->ChoosenParam_lb->setCurrentItem(i); //Test
b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
s=b->ChoosenParam_lb->currentText();//Test
printf("Choosen Param : %s\n",s);//Test
}
}
else
{
for (i=0; i<size1; i++)
{
b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
}
}
if ( a!=0)
{
for (i=0; i<a; i++)
{
b->ChoosenParam_lb->insertItem ( table1->text(i,0), -1 );
}
}
To copy to clipboard, switch view to plain text mode
Please see this and tell me what wrong.
With Kind Regards
Kenny
Bookmarks