[solved]Troubles with textEdit signals



  • I'm tryin to use textEdit signal textChanged() to call slot mySlot(QString), which should make button available when user is typing some text.

    void MyDialogWindow::mySlot(QString str)
    {
    ui->pushButton->setEnabled(!str.isEmpty());
    }

    connect(ui->textEdit, SIGNAL(textChanged(QString)), this, SLOT(mySlot(QString));

    But when I type some text nothing happens. If I use lineEdit instead textEdit - everything is ok and mySlot works fine. What's the problem with textEdit signal?


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    QTeditEdit's textChanged is a signal with not parameter, you can't connect it to a slot that has a parameter. Just remove it, and check your textEdit content there.



  • @SGaist OH! Thank you so much! I spent a few hours trying to find a solution and the problem was so simple)


  • Lifetime Qt Champion

    You're welcome !

    Since you have it working now, please update the thread title prepending [solved] so other forum users may know a solution has been found :)

    Also, while browsing the forum, consider up-voting answer that helps you, it will help other users to find them more easily :)


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.