Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. [solved]Troubles with textEdit signals
QtWS25 Last Chance

[solved]Troubles with textEdit signals

Scheduled Pinned Locked Moved General and Desktop
4 Posts 2 Posters 916 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    AntonZelenin
    wrote on last edited by AntonZelenin
    #1

    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?

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      A 1 Reply Last reply
      1
      • SGaistS SGaist

        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.

        A Offline
        A Offline
        AntonZelenin
        wrote on last edited by
        #3

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

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          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 :)

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          0

          • Login

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • Users
          • Groups
          • Search
          • Get Qt Extensions
          • Unsolved