Results 1 to 3 of 3

Thread: Error--High Priority

  1. #1
    Join Date
    Feb 2009
    Posts
    189
    Thanks
    2

    Unhappy Error--High Priority

    Dear Friends...
    I am getting an error as
    MainWindow::MainWindow(QMainWindow *):
    :Undefined reference to vtable for MainWindow

    Could anyone please tell me what is the reason of this error..???

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Error--High Priority

    1. Make sure the Q_OBJECT macro is present in the definition of all QObject-derived classes.
    2. Make sure you define your QObject-derived classes in your header files ONLY.
    3. Make sure all of your header files are listed in your .pro file in the HEADERS= list.
    4. Run qmake every time you add Q_OBJECT to one of your classes or modify your .pro file.
    J-P Nurmi

  3. #3
    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: Error--High Priority

    I will also add:

    5. Make sure you implemented the constructor you had declared in the class header.

    By the way, having a main window constructor that takes a QMainWindow as its parent is probably an error in design.

Similar Threads

  1. Qt thread priority
    By SailinShoes in forum Qt Programming
    Replies: 1
    Last Post: 16th June 2010, 01:39
  2. priority of QThread
    By quickNitin in forum Qt Programming
    Replies: 3
    Last Post: 13th May 2006, 12:53

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.