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[])
{
Ui::MainWindow ui;
ui.setupUi(main);
ui.
webView->load
(QUrl("http://www.trolltech.com/"));
ui.webView->show();
QObject::connect(ui.
cmdBtn,
SIGNAL(clicked
()),ui.
webView,
SLOT(load
(QUrl("http://www.google.com/"))));
main->show();
return app.exec();
}
#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.webView,SLOT(load(QUrl("http://www.google.com/"))));
main->show();
return app.exec();
}
To copy to clipboard, switch view to plain text mode
Please help me, if you can!
Bookmarks