PDA

View Full Version : QWebView unknown problem



morfei
3rd August 2008, 11:38
I'm sure that the problem is in the code but i'm really newbie in Qt and can't find it.As you can see at the code I'm trying to create a connection between a buton and the webview object but it doesnt work when i test it.I keep pushing the buton but there's no change in the page.So here's the code:


#include <QApplication>
#include <QMainWindow>
#include "ui_test.h"
int main(int argc, char *argv[])
{
QApplication app(argc, argv);
Ui::MainWindow ui;
QMainWindow *main = new QMainWindow;
ui.setupUi(main);
ui.webView->load(QUrl("http://www.trolltech.com/"));
ui.webView->show();
QObject::connect(ui.cmdBtn,SIGNAL(clicked()),ui.we bView,SLOT(load(QUrl("http://www.google.com/"))));
main->show();
return app.exec();
}


Please help me, if you can!

jacek
5th August 2008, 00:12
You can't specify values and parameter names in SLOT() and SIGNAL() macros --- only types.

http://www.qtcentre.org/forum/faq.php?faq=qt_signalslot#faq_qt_signalslot_with_v alues