PDA

View Full Version : Checkbox Setfocus



afro_cv
20th August 2011, 18:54
I need an example, as moves to a qlineedit after i presses a checkbox:
something like that


ui->txtGarg - QLineEdit

void protocolonutri::on_cboOthersGarg_toggled(bool checked)
{
ui->txtGarg->setEnabled(checked);
if (!checked)
ui->txtGarg->setText("");

else
ui->txtGarg->setFocus();
}

SetFocus Doesnt Work Well, how i can do?
Sorry for my english

qlands
22nd August 2011, 09:02
Try setFocus(Qt::OtherFocusReason)

afro_cv
23rd August 2011, 14:09
i try but dont work