PDA

View Full Version : No Matching function to call...



weepdoo
7th November 2008, 16:31
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):


connect(this->m_ui->searchField, SIGNAL(textEdited(const QString &)),
this, SIGNAL(searchStringChanged(const QString &)));


In my main window constructor I dot that:


m_searchdialog = new searchDialog();
m_searcher = new searcher();

connect(m_searchdialog, SIGNAL(searchStringChanged(const QString &)),
m_searcher, SLOT(newResearch(const QString &)));


And when I compile I've got this error:


mainwindow.cpp:19: error: no matching function for call to ‘mainWindow::connect(searchDialog*&, const char [38], searcher*&, const char [30])’

/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)
/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


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

caduel
7th November 2008, 18:01
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

receiver->connect(sender, SIGNAL(...), SLOT(...));

weepdoo
7th November 2008, 18:30
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