collycrk
18th August 2015, 17:12
I have a number of lineEdit widgets and I'm using signal and slots to capture the returnPressed event. Which will step to the next lineEdit.
It works well except for one one hic-up. It takes two presses of the return key to get it to step.
Here is the code:
void test_Dialog::on_lineEdit_name_returnPressed()
{
connect(ui->lineEdit_name, SIGNAL(returnPressed()),
ui->lineEdit_address, SLOT(setFocus()));
}
Is there a better way to do this, or am I leaving something out?
Your advise will be must welcomed.
It works well except for one one hic-up. It takes two presses of the return key to get it to step.
Here is the code:
void test_Dialog::on_lineEdit_name_returnPressed()
{
connect(ui->lineEdit_name, SIGNAL(returnPressed()),
ui->lineEdit_address, SLOT(setFocus()));
}
Is there a better way to do this, or am I leaving something out?
Your advise will be must welcomed.