Results 1 to 3 of 3

Thread: Qt compile-time error

  1. #1
    Join Date
    Jan 2009
    Posts
    29
    Qt products
    Qt4
    Platforms
    Unix/X11

    Question Qt compile-time error

    Qt version: 4.5.2.

    I am writing an open source program, however it doesn't compile (QObject::connect() call doesn't compile).

    May anyone tell me why?


    The source code is available here:

    http://www.cpp-software.net/temp/p-s.zip


    Thank you a lot.

  2. #2
    Join Date
    Apr 2010
    Location
    Rostov-na-Donu, Russia
    Posts
    153
    Thanks
    2
    Thanked 26 Times in 23 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: Qt compile-time error

    your class PortScannerEngine should be derived from QObject. change
    Qt Code:
    1. class PortScannerEngine
    To copy to clipboard, switch view to plain text mode 
    to
    Qt Code:
    1. class PortScannerEngine : public QObject
    To copy to clipboard, switch view to plain text mode 

    P.S. by the way, do not attach small code. just insert it in your post

  3. #3
    Join Date
    Jan 2009
    Posts
    29
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: Qt compile-time error

    Quote Originally Posted by borisbn View Post
    your class PortScannerEngine should be derived from QObject. change
    Qt Code:
    1. class PortScannerEngine
    To copy to clipboard, switch view to plain text mode 
    to
    Qt Code:
    1. class PortScannerEngine : public QObject
    To copy to clipboard, switch view to plain text mode 
    Thank you for your reply.

    Although I had checked the QObject derivation, somehow I missed it.

Similar Threads

  1. no compile error, but error on run with QMenu QAction
    By sincnarf in forum Qt Programming
    Replies: 4
    Last Post: 4th May 2011, 11:05
  2. compile time error porting Qt3 designer form to Qt4
    By ashukla in forum Qt Programming
    Replies: 3
    Last Post: 20th September 2007, 11:48
  3. Run Time Error.
    By kenny_isles in forum Newbie
    Replies: 1
    Last Post: 6th March 2007, 09:19
  4. Qt 4.2.1 Run Time Error
    By Rayven in forum Qt Programming
    Replies: 1
    Last Post: 31st October 2006, 16:13
  5. setWindowTitle and last compile date/time
    By jcr in forum Qt Programming
    Replies: 1
    Last Post: 8th April 2006, 23:59

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.