Results 1 to 3 of 3

Thread: No Matching function to call...

  1. #1
    Join Date
    Jul 2006
    Location
    France
    Posts
    34
    Thanks
    12
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Question No Matching function to call...

    Hy,

    I'm a bit new to Qt and C++ (even if I have program in different languages).

    I've got a search box with this in (searchFiled is a QLineEdit):
    Qt Code:
    1. connect(this->m_ui->searchField, SIGNAL(textEdited(const QString &)),
    2. this, SIGNAL(searchStringChanged(const QString &)));
    To copy to clipboard, switch view to plain text mode 

    In my main window constructor I dot that:
    Qt Code:
    1. m_searchdialog = new searchDialog();
    2. m_searcher = new searcher();
    3.  
    4. connect(m_searchdialog, SIGNAL(searchStringChanged(const QString &)),
    5. m_searcher, SLOT(newResearch(const QString &)));
    To copy to clipboard, switch view to plain text mode 

    And when I compile I've got this error:
    Qt Code:
    1. mainwindow.cpp:19: error: no matching function for call to ‘mainWindow::connect(searchDialog*&, const char [38], searcher*&, const char [30])’
    2.  
    3. /usr/local/Trolltech/Qt-4.1.4/include/QtCore/qobject.h:176: note: candidates are: static bool QObject::connect(const QObject*, const char*, const QObject*, const char*, Qt::ConnectionType)
    4. /usr/local/Trolltech/Qt-4.1.4/include/QtCore/qobject.h:276: note: bool QObject::connect(const QObject*, const char*, const char*, Qt::Connection Type) const
    To copy to clipboard, switch view to plain text mode 

    Any idea ?
    Because I'm stuck for 2 hours... I'm a little bit bored now :P

  2. #2
    Join Date
    Dec 2006
    Posts
    849
    Thanks
    6
    Thanked 162 Times in 151 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: No Matching function to call...

    3 possibilites:

    1) the place you call connect in is not a subclass of QObject
    2) m_searcher is not a subclass of QObject
    3) m_searchdialog is not a subclass of QObject

    usually it's 1)

    HTH

    PS: if it is 1), you may fix it with
    Qt Code:
    1. receiver->connect(sender, SIGNAL(...), SLOT(...));
    To copy to clipboard, switch view to plain text mode 

  3. The following user says thank you to caduel for this useful post:

    weepdoo (7th November 2008)

  4. #3
    Join Date
    Jul 2006
    Location
    France
    Posts
    34
    Thanks
    12
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: No Matching function to call...

    Quote Originally Posted by caduel View Post
    3 possibilites:

    1) the place you call connect in is not a subclass of QObject
    2) m_searcher is not a subclass of QObject
    3) m_searchdialog is not a subclass of QObject

    usually it's 1)

    HTH
    Actually it was 2).

    May I worship you ? :P

Similar Threads

  1. QPSQL problem
    By LoneWolf in forum Installation and Deployment
    Replies: 60
    Last Post: 4th November 2009, 14:22
  2. QPSQL driver in windows
    By brevleq in forum Installation and Deployment
    Replies: 31
    Last Post: 14th December 2007, 12:57
  3. how to add static library into qmake
    By Namrata in forum Qt Tools
    Replies: 1
    Last Post: 20th November 2007, 17:33
  4. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  5. use qpsql
    By raphaelf in forum Installation and Deployment
    Replies: 34
    Last Post: 22nd August 2006, 12:52

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.