error with a signal - slot
Hi,
I'm using QWebView with the signal LoadFinished but I have the error:
Code:
/home/david/proyectos qt/networkacessmanager/red/mainwindow.cpp:17: error: no matching function for call to ‘MainWindow::connect(QWebView&, const char*, MainWindow* const, const char*)’
The code is:
Mainwindow.cpp
Code:
MainWindow
::MainWindow(QWidget *parent
){
ui->setupUi(this);
QNetworkAccessManager *manager = new QNetworkAccessManager(this);
manager
->get
(QNetworkRequest
(QUrl("http://qt.nokia.com")));
QWebView webview;
webview.
setUrl(QUrl("http://www.google.com"));
connect(webview,SIGNAL(loadFinished(bool)), this, SLOT(salida(bool)));
.......
}
void MainWindow::salida(bool ok)
{
ok = false;
}
mainwindow.h
Code:
{
....
....
private slots:
void salida(bool ok);
Any help?
Many thanks!
Re: error with a signal - slot
Use the Q_OBJECT macro in your class definition!
EDIT: and your QWebView should be created on the heap, because it will be deleted after the constructor...