[Qt-interest] lineEdit returnPressed() signal doesn't seem to work
Alexei Vinidiktov
alexei.vinidiktov at gmail.com
Wed Apr 29 11:01:41 CEST 2009
Never mind. I got it sorted out. Turns out after I upgraded Qt
Designer to 1.1 there were some problems with app builds. I had to
remove the .pro.user file for the project builds to resume working
again.
On Tue, Apr 28, 2009 at 9:14 PM, Alexei Vinidiktov
<alexei.vinidiktov at gmail.com> wrote:
> Hello,
>
> I have a basic question.
>
> I've tried to connect the returnPressed() signal of a lineEdit control
> to a slot, but the signal doesn't seem to be emitted. When I run the
> compiled program and press the Enter key, nothing happens.
>
> The lineEdit's name is lineEdit1. The whole ui is done in the Qt
> Creator's visual designer.
>
> I've added a slot void on_lineEdit1_returnPressed() to the slots
> definitions and implemented it like this:
>
> void MainWindow::on_lineEdit1_returnPressed()
> {
> loadPage(ui->lineEdit1->text());
> }
>
> I've also tried adding connect(ui->lineEdit1, SIGNAL(returnPressed()),
> this, SLOT(on_lineEdit1_returnPressed())); to the MainWindow's
> constructor, but it didn't work either.
>
> I don't use a validator for the linEdit control. Do I have to use one
> for the returnPressed signal to be emitted?
>
> Qt 4.5.1 on Windows XP with Qt Creator 1.1
>
> Thanks.
>
> --
> Alexei Vinidiktov
>
--
Alexei Vinidiktov
More information about the Qt-interest-old
mailing list