5

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

  • error: incomplete type 'QUrl' used in nested name specifier
  • error: invalid use of incomplete type 'class QUrl'
  • error: forward declaration of 'class QUrl'

1 Answer 1

9

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

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

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.