Results 1 to 11 of 11

Thread: Issue with QObject::connect

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2012
    Posts
    4
    Qt products
    Qt3 Qt4 PyQt3 PyQt4
    Platforms
    Unix/X11 Windows

    Default Re: Issue with QObject::connect

    Sorry.Here's my test.h file

    Qt Code:
    1. #ifndef WIDGET_H
    2. #define WIDGET_H
    3. #include <QWidget>
    4.  
    5. using namespace std;
    6. namespace Ui {
    7. class calc;
    8. }
    9.  
    10. class calc : public QWidget {
    11. Q_OBJECT
    12. public:
    13. calc(QWidget *parent = 0);
    14. ~calc();
    15.  
    16.  
    17. protected:
    18.  
    19. private:
    20. Ui::calc *ui;
    21.  
    22. private slots:
    23.  
    24. public slots:
    25. int appendone();
    26. };
    27. #endif // WIDGET_H
    To copy to clipboard, switch view to plain text mode 

    I created an object for calc in my C++ file
    Qt Code:
    1. calc c;
    To copy to clipboard, switch view to plain text mode 
    Now I'm getting the following error

    Qt Code:
    1. /home/anil/Tests/Qt/test/test.cpp:10: undefined reference to `calc::calc(QWidget*)'
    2. /home/anil/Tests/Qt/test/test.cpp:10: undefined reference to `calc::~calc()'
    3. collect2: ld returned 1 exit status
    4. make: *** [test] Error 1
    To copy to clipboard, switch view to plain text mode 

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

    Default Re: Issue with QObject::connect

    You're missing a body for your constructor and your destructor. Did you implement them?
    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.


Similar Threads

  1. QObject::connect
    By littlepig in forum Newbie
    Replies: 4
    Last Post: 9th February 2011, 12:08
  2. [Help] QObject::connect
    By vinny gracindo in forum Newbie
    Replies: 3
    Last Post: 20th October 2009, 13:26
  3. QObject::connect (fast)
    By baray98 in forum Qt Programming
    Replies: 1
    Last Post: 22nd February 2008, 06:30
  4. QObject::connect: No such signal
    By caseyong in forum Qt Programming
    Replies: 5
    Last Post: 19th February 2008, 07:23
  5. Replies: 4
    Last Post: 10th November 2006, 15:38

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.