-2

I'm fairly new to Qt and I'm trying to work with Signals and Slots and I'm having a bit of trouble creating custom Slots:

public slots:
    void resetUrl(){
        this->load(QUrl("http://www.google.com"));
    }

(Then, in my main.cpp)

#include <QWebView>
#include <QPushButton>

QWebView *web = new QWebView(mainwindow);
QPushButton *button = new QPushButton(mainwindow);

web->load(QUrl("http://www.yahoo.com"));
button->setText("Google");

QObject::connect(button, SIGNAL(clicked()), web, SLOT(resetUrl()));

Thats about all I got, any help is appreciated. What it says when I try to run this is "'class google' has no member named 'load'".

Connor M
  • 331
  • 3
  • 5
  • 18

1 Answers1

0

I'm sure your class has no load function, you want web->load(url) NOT this->load(url)

headsvk
  • 2,726
  • 1
  • 19
  • 23