Results 1 to 3 of 3

Thread: Q_object???

  1. #1
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Q_object???

    Hi,
    I'm trying to declare a slot called change() in my class myprocessor. so this is what i do:

    #include <QObject>
    class MyProcessor : public QObject
    {
    Q_OBJECT
    public slots:
    void change();
    ...and so on...

    now, when i try to compile, this is what it throws back:
    Qt Code:
    1. main.o(.gnu.linkonce.t._ZN11MyProcessorC1Ev+0x1c): In function `MyProcessor::MyProcessor[in-charge]()':
    2. /usr/local/Trolltech/Qt-4.1.0/include/QtCore/arch/qatomic.h:70: undefined reference to `vtable for MyProcessor'
    3. main.o(.gnu.linkonce.t._ZN11MyProcessorD1Ev+0xc): In function `MyProcessor::~MyProcessor [in-charge]()':
    4. /usr/local/Trolltech/Qt-4.1.0/include/QtGui/qimage.h:164: undefined reference to `vtable for MyProcessor'
    5. collect2: ld returned 1 exit status
    6. make: *** [videochoice] Error 1
    To copy to clipboard, switch view to plain text mode 

    if i don't include the Q_OBJECT, the it says:
    Qt Code:
    1. Object::connect: No such slot QObject::change()
    To copy to clipboard, switch view to plain text mode 

    What do i do??
    superutsav
    He who laughs last thinks slowest.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Q_object???

    Have you run qmake after adding Q_OBJECT to your class?

    http://www.qtcentre.org/forum/showthread.php?t=811

  3. #3
    Join Date
    Jan 2006
    Posts
    22
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Q_object???

    Thanks, that did it..
    superutsav
    He who laughs last thinks slowest.

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.