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

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.
  • SolaVitaeS Offline
    SolaVitaeS Offline
    SolaVitae
    wrote on 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

    jsulmJ 1 Reply Last reply
    0
    • SolaVitaeS SolaVitae

      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

      jsulmJ Offline
      jsulmJ Offline
      jsulm
      Lifetime Qt Champion
      wrote on 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 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

        • Login

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