Results 1 to 14 of 14

Thread: Why Qt can not find a public slot?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Feb 2008
    Location
    Russia, Moscow
    Posts
    35
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Why Qt can not find a public slot?

    Like this?
    Qt Code:
    1. using namespace qmapcontrol;
    2. class mwnd : public QWidget
    3. {
    4. Q_OBJECT
    5. public:
    6. mwnd(QWidget* parent = 0);
    7. ~mwnd();
    To copy to clipboard, switch view to plain text mode 

    If I write this - I recieve this:
    Qt Code:
    1. :-1: error: collect2: ld returned 1 exit status
    To copy to clipboard, switch view to plain text mode 

  2. #2
    Join Date
    Feb 2009
    Location
    Noida, India
    Posts
    517
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows
    Thanks
    21
    Thanked 66 Times in 62 Posts

    Default Re: Why Qt can not find a public slot?

    can you post the whole error? this is just linker stopping cuz of some error that occured before

  3. #3
    Join Date
    Feb 2008
    Location
    Russia, Moscow
    Posts
    35
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Why Qt can not find a public slot?

    Sorry, I don't understand.
    I write all I have... Where is my bad?

  4. #4
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Why Qt can not find a public slot?

    you have to rebuild your app after adding Q_OBJECT macro.
    so, do this
    make/mingw32-make/nmake clean
    qmake
    make/mingw32-make/nmake
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  5. #5
    Join Date
    Feb 2008
    Location
    Russia, Moscow
    Posts
    35
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Why Qt can not find a public slot?

    Rebuilding and cleaning does not help =(

    Why the compiler can not find the socket if it was declared?

  6. #6
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows
    Thanked 370 Times in 336 Posts

    Default Re: Why Qt can not find a public slot?

    can you attach compilable example?
    Qt Assistant -- rocks!
    please, use tags [CODE] & [/CODE].

  7. #7
    Join Date
    Feb 2008
    Location
    Russia, Moscow
    Posts
    35
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows
    Thanks
    1
    Thanked 1 Time in 1 Post

    Default Re: Why Qt can not find a public slot?

    Problem is solved. Thank you!
    It's realy my bad. When I cleaning up my project from terminal (qmake clean) some files are missed and doesn't deleted. And when I cleaning by myself - application start's normaly.

  8. #8
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Wiki edits
    5

    Default Re: Why Qt can not find a public slot?

    Quote Originally Posted by Alex Snet View Post
    (qmake clean)
    Typo? It has to be make clean!

Similar Threads

  1. Problem When Creating my own Slot
    By Fatla in forum Qt Programming
    Replies: 12
    Last Post: 6th June 2008, 15:44
  2. problems installing Qt opensource with msvc2008 support
    By odin1985 in forum Installation and Deployment
    Replies: 6
    Last Post: 24th May 2008, 10:06
  3. Replies: 1
    Last Post: 6th March 2007, 16:27
  4. Link Errors
    By magikalpnoi in forum Qt Programming
    Replies: 5
    Last Post: 25th September 2006, 23:04

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.