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. Signal Not Found for QComboBox
QtWS25 Last Chance

Signal Not Found for QComboBox

Scheduled Pinned Locked Moved Unsolved General and Desktop
qcomboboxsignal
3 Posts 3 Posters 3.9k 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.
  • S Offline
    S Offline
    SolaVitae
    wrote on 12 May 2017, 05:07 last edited by
    #1

    i cant seem to figure out why, but i keep getting this error

    QObject::connect: No such signal QComboBox::currentIndexChanged(const QString & text) in mainwidgets.cpp:251
    QObject::connect:  (sender name:   'charactersBox')
    QObject::connect:  (receiver name: 'CharacterViewSettings')
    

    i am connecting the signal with this line of code

    connect(charactersBox, SIGNAL(currentIndexChanged(const QString & text)), this, SLOT(characterSelectedChange(const QString & text)));
    

    and i am declaring the QComboBox with this line of code

    charactersBox = findChild<QComboBox*>("charactersBox");
    

    the child is just a QComboBox in my .ui file with nothing special about it, also named appropriately. All the other widgets in my .ui have no problem connecting signals, its just this combo box, which also wont work with any of its signals all giving the same error

    J 1 Reply Last reply 12 May 2017, 06:22
    0
    • S SolaVitae
      12 May 2017, 05:07

      i cant seem to figure out why, but i keep getting this error

      QObject::connect: No such signal QComboBox::currentIndexChanged(const QString & text) in mainwidgets.cpp:251
      QObject::connect:  (sender name:   'charactersBox')
      QObject::connect:  (receiver name: 'CharacterViewSettings')
      

      i am connecting the signal with this line of code

      connect(charactersBox, SIGNAL(currentIndexChanged(const QString & text)), this, SLOT(characterSelectedChange(const QString & text)));
      

      and i am declaring the QComboBox with this line of code

      charactersBox = findChild<QComboBox*>("charactersBox");
      

      the child is just a QComboBox in my .ui file with nothing special about it, also named appropriately. All the other widgets in my .ui have no problem connecting signals, its just this combo box, which also wont work with any of its signals all giving the same error

      J Offline
      J Offline
      jsulm
      Lifetime Qt Champion
      wrote on 12 May 2017, 06:22 last edited by
      #2

      @SolaVitae Remove parameter names from connect and try again:

      connect(charactersBox, SIGNAL(currentIndexChanged(QString)), this, SLOT(characterSelectedChange(QString)));
      

      https://forum.qt.io/topic/113070/qt-code-of-conduct

      1 Reply Last reply
      5
      • M Offline
        M Offline
        mostefa
        wrote on 12 May 2017, 06:28 last edited by
        #3

        Hi @SolaVitae , as suggested by @jsulm you have to delete param name in connect signal,

        you can keep const &

        Your connect will be then:

        connect(charactersBox, SIGNAL(currentIndexChanged(const QString &)), this, SLOT(characterSelectedChange(const QString &)));

        1 Reply Last reply
        1

        1/3

        12 May 2017, 05:07

        • Login

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