Ibrahim MAATKI
Ibrahim MAATKI

Reputation: 363

Open url on an external browser on button click in a Qt application

My application should contains a button which when you click on it an external browser should be opened here is my code

void Logindialog::on_inscriptionPushButton_clicked()
{
  QDesktopServices::openUrl(QUrl("http://www.google.com", QUrl::TolerantMode));
}

but when i compile i get this list of errors

Upvotes: 5

Views: 4355

Answers (1)

sanosdole
sanosdole

Reputation: 2489

You forgot to include QUrl, as only a forward declaration exists.

Use either #include <QUrl> or #include <QtCore> at the top of your file.

Upvotes: 9

Related Questions