Results 1 to 8 of 8

Thread: "No such slot..."

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: "No such slot..."

    My guess is you added the "Q_OBJECT" macro to an existing file and you didn't rerun qmake afterwards.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Wiki edits
    17

    Default Re: "No such slot..."

    My guess is more fundamental: The declaration of those slots in the Dialog class are commented out and there is no implementation of them at all. Since the parent class (QDialog) also has no slots of those names that you inherit you get the warnings when the Designer Ui code tries to connect.

  3. #3
    Join Date
    May 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: "No such slot..."

    I thought i know enough to start qt, but i was wrong. But i want to finish this program. I've uncomment slots and tried with moving declaration to dialog.h and dialog.cpp. Now the problem is undefined reference to Dialog::decChanged(QString const&) and others slots in moc_dialog.cpp. Please give me instructions what to do and i will be back much more experienced...

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: "No such slot..."

    Did you rerun qmake?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  5. #5
    Join Date
    May 2012
    Posts
    3
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: "No such slot..."

    Of course i did. Several times.

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: "No such slot..."

    Is decChanged() a slot or a signal? How is it declared in the class?
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  7. #7

    Default Re: "No such slot..."

    Hi,

    I'm new to Qt and C++ so I'm asking questions about this problem to learn and test my knowledge. Unfortunately I don't have the "for sure" answer.

    I'm not familiar with the book you are using. Does it have you modify the ui_... .h file?

    I would try uncommenting the slot declarations in the dialog.h file, then add the slot functions to the dialog.cpp file e.g.
    Qt Code:
    1. Dialog::void decChanged (const QString &newValue)
    2. {
    3. bool ok;
    4. int num = newValue.toInt(&ok);
    5. if (ok) {
    6. hexEdit->setText(QString::number(num, 16));
    7. binEdit->setText(QString::number(num, 2));
    8. } else {
    9. hexEdit->setText("0");
    10. binEdit->setText("0");
    11. }
    12. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Replies: 5
    Last Post: 24th May 2010, 22:20
  2. debugging "signal does not reach slot" in a template class
    By Daniel Dekkers in forum Qt Programming
    Replies: 1
    Last Post: 3rd April 2010, 17:03
  3. Replies: 1
    Last Post: 5th January 2010, 14:34
  4. Replies: 1
    Last Post: 23rd August 2008, 23:09
  5. Translation QFileDialog standart buttons ("Open"/"Save"/"Cancel")
    By victor.yacovlev in forum Qt Programming
    Replies: 4
    Last Post: 24th January 2008, 20:05

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.