Results 1 to 8 of 8

Thread: Connect SLOTS in QApplication problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2013
    Location
    India
    Posts
    153
    Thanks
    27
    Thanked 18 Times in 18 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Connect SLOTS in QApplication problem

    Thanks it works... :P
    i feel like dumb

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,321
    Thanks
    316
    Thanked 871 Times in 858 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Connect SLOTS in QApplication problem

    virtual bool notify(QObject *receiver, QEvent *event);
    virtual bool event (QEvent * e);
    You don't intend for these to be slots, do you? Why are they included in the slots declaration of your class?

  3. #3
    Join Date
    Apr 2013
    Location
    milan
    Posts
    13
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Connect SLOTS in QApplication problem

    I've had the same problem today I've solved implementing explicitly a destructor... an empty one does the trick too!

    Then the 'vtable' it was defined again... whatever it is!

    I have really the G++ errors they simply means nothing...

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Connect SLOTS in QApplication problem

    The vtable error is typical artifact when a Q_OBJECT marker is added to a header that did not contain it at the time the header was added to the project.
    All headers with that marker need to be processed by MOC, when a header is added to the .pro file then it is checked for whether this is necessary.
    If the header at this time does not contain the marker yet, no MOC rule is generated. Adding the marker afterwards thus leaves the file only temporarily processed.

    Re-running qmake (either manually or though QtCreator's build menu) will always fix that.

    Generally it is most easily avoided by always putting the Q_OBJECT marker into classes directly or indirectly derived from QObject.

    Cheers,
    _

  5. The following user says thank you to anda_skoa for this useful post:

    rawfool (10th May 2013)

Similar Threads

  1. Replies: 2
    Last Post: 18th April 2013, 12:15
  2. How to use connect() in IDE's(slots)
    By wenn32 in forum Newbie
    Replies: 7
    Last Post: 6th July 2010, 16:21
  3. Replies: 16
    Last Post: 16th February 2010, 13:17
  4. Connect to...without slots...
    By Peppy in forum Qt Programming
    Replies: 2
    Last Post: 16th October 2009, 13:47
  5. Where to ::connect() QApplication::aboutToClose()
    By Jason Hamilton in forum Qt Programming
    Replies: 2
    Last Post: 4th September 2008, 01:40

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.