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] Signal & slots, need another pair of eyes on this

[SOLVED] Signal & slots, need another pair of eyes on this

Scheduled Pinned Locked Moved General and Desktop
9 Posts 5 Posters 1.9k Views 1 Watching
  • 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
    sharon_obl82
    wrote on last edited by
    #1

    Hi,

    I need another pair of eyes to help me look at this error code:

    QObject::connect: No such slot RadioUserWindow::getrsnridsignal(QString,int) in ....\radiouser_config_rsn_rid.cpp:43
    QObject::connect: (sender name: 'radiouser_config_rsn_rid')
    QObject::connect: (receiver name: 'RadioUserWindow')
    col1 is "CU$9"
    col2 is 9
    emit signal from rsnrid

    I have this form "radiouser_config_rsn_rid" which is being called by "RadioUserWindow". radiouser_config_rsn_rid will perform a query search in the database and displays the results in a table.User may then select a row on the table and click OK, which then radiouser_config_rsn_rid will send the data values to the parent RadioUserWindow lineedit ui.

    Here's how i code it:

    radiouser_config_rsn_rid.cpp:
    @
    connect(this,SIGNAL(rsnridsignal(QString,int)),parentWidget(),SLOT(getrsnridsignal(QString,int)));

    void radiouser_config_rsn_rid::on_pushButton_3_clicked() //this is the OK button
    {
    QModelIndex idx = ui->tableView->currentIndex();
    col1 = rsnrid_list->item(idx.row(),0)->text();
    col2 = rsnrid_list->item(idx.row(),1)->text().toInt();
    qDebug() << "col1 is" << col1 ; //the values can be displayed correctly
    qDebug() << "col2 is" << col2 ;
    emit rsnridsignal(col1,col2);
    qDebug() << "emit signal from rsnrid" ;
    this->close();
    }
    @

    in RadioUserWindow.cpp:
    @
    void RadioUserWindow::getrsnridsignal(QString rsn, int rid)
    {
    qDebug() << "signal received";
    rsn = col1;
    rid = col2;
    ui->lineEdit_14->text() = rsn;
    ui->lineEdit_15->text() = rid;
    }

    @

    Can someone pinpoint where is wrong please? Thank you!

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      Please post RadioUserWindow.h also.

      157

      1 Reply Last reply
      0
      • S Offline
        S Offline
        sharon_obl82
        wrote on last edited by
        #3

        Hi,
        RadioUserWindow.h contains this line

        void getrsnridsignal(QString, into rid);

        1 Reply Last reply
        0
        • JKSHJ Offline
          JKSHJ Offline
          JKSH
          Moderators
          wrote on last edited by
          #4

          [quote author="sharon_obl82" date="1412674198"]Hi,
          RadioUserWindow.h contains this line

          void getrsnridsignal(QString, into rid);[/quote]Is it a slot?

          Please post the whole header.

          Qt Doc Search for browsers: forum.qt.io/topic/35616/web-browser-extension-for-improved-doc-searches

          1 Reply Last reply
          0
          • S Offline
            S Offline
            sharon_obl82
            wrote on last edited by
            #5

            signals:
            void getrsnridsignal(QString, into rid);

            1 Reply Last reply
            0
            • p3c0P Offline
              p3c0P Offline
              p3c0
              Moderators
              wrote on last edited by
              #6

              getrsnridsignal(QString, into rid) is supposed to be a slot and not a signal.

              157

              1 Reply Last reply
              0
              • S Offline
                S Offline
                sharon_obl82
                wrote on last edited by
                #7

                oh dear.. you're right!
                Thank you very much! it works! :)

                1 Reply Last reply
                0
                • IamSumitI Offline
                  IamSumitI Offline
                  IamSumit
                  wrote on last edited by
                  #8

                  Hi
                  if your problem is solved please add [SOLVED] before thread title.
                  so other members can notify that problem has been solved.

                  Be Cute

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

                    Hi,

                    On a side note, it's legal to connect a signal to another signal (it's signal forwarding), just change the macro.

                    But in any case, you should change the name of your signals and slots to something more meaningful, it will avoid such confusion ;)

                    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