Hello, i am trying to populate a QListWidget with the names Somename_1 to Somename_300.. But the problem is the names start with Somename_300 and decrement down to Somename_1 in the QListWidget.. How can i make it insert from Somename_1 and increment to Somename_300.
for( int i=0 ; i<300; i++ )
{
listWidgetdata
+= QString("SOmename_%1").
arg(i
) + (i
==299 ?
"" : "");
",");
}
for(int j=0; j < listWidgetdata.count();j++)
{
ParamsLW->insertItem(kfast,listWidgetdataat(j)); // kfast =0; at the start of the program
ksast++;
}
for( int i=0 ; i<300; i++ )
{
listWidgetdata += QString("SOmename_%1").arg(i) + (i==299 ? "" : "");",");
}
for(int j=0; j < listWidgetdata.count();j++)
{
QListWidgetItem(item[kfast]->text());
ParamsLW->insertItem(kfast,listWidgetdataat(j)); // kfast =0; at the start of the program
ksast++;
}
To copy to clipboard, switch view to plain text mode
ParamsLW is the object name for the QListWidget.
what is going wrong why is the counter starting the names from 300 instead of 1.
thank you
Bookmarks