i changed the code theory to this one and its worked fine
:
void CheckoutDialog::on_empNoEdit_textChanged()
{
int k=1;
query.first();
//_______check for item(0)____________
if (ui->empNoLine->text().toInt()==query.value(0).toInt())
{
ui->empNameBox->setCurrentIndex(k);
}
//_____________________________________
//_______for the rest of items___________
while(query.next())
{
if (ui->empNoLine->text().toInt()==query.value(0).toInt())
{
ui->empNameBox->setCurrentIndex(k);
break;
}
k++;
}
//_________________________________________
}
void CheckoutDialog::on_empNoEdit_textChanged()
{
int k=1;
query.first();
//_______check for item(0)____________
if (ui->empNoLine->text().toInt()==query.value(0).toInt())
{
ui->empNameBox->setCurrentIndex(k);
}
//_____________________________________
//_______for the rest of items___________
while(query.next())
{
if (ui->empNoLine->text().toInt()==query.value(0).toInt())
{
ui->empNameBox->setCurrentIndex(k);
break;
}
k++;
}
//_________________________________________
}
To copy to clipboard, switch view to plain text mode
is there any way to do this in a simple way ?
Bookmarks